Answer the question
In order to leave comments, you need to log in
How to add a property to an object in VkScript (not through ".")?
There is this code:
var source = Args.source;
var targets = Args.targets;
// var common_friends = {};
var common_friends = [];
var req;
var parametr = "";
var start = 0;
// из строки с целями вынимаем каждую цель
while(start<=targets.length-1){
if (targets.substr(start, 1) != "," && start != targets.length-1){
parametr = parametr + targets.substr(start, 1);
}
else {
// сразу делаем запросы, как только вытащили id
req = API.friends.getMutual({"source_uid":source, "target_uid":parametr});
common_friends = common_friends + req;
// а нужно common_friends[parametr] = req; VkScript похоже не поддерживает
parametr = "";
}
start = start + 1;
}
return common_friends;
{'id': [список общих друзей], 'id': [], 'id': [friend_id1, friend_id2],
var a = {};
a["name"] = 123;
error: non-variable in assignment
var a = {};
a.name = 123;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question