I would like to give some feedback about ...
From: https://js.checkio.org/mission/common-words/solve/
HTTP_USER_AGENT:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
function commonWords(first, second) {
var list1 = first.split(",");
var list2 = second.split(",");
var res = [];
for(var i=0;i<list1.length;i++){
for(var j=0;j<list2.length;j++){
if(list1[i]===list2[j]){
res.push(list1[i]);
}
}
}
return res.join();
}
with test data > commonWords("one,two,three", "four,five,one,two,six,three");
should give "one,two,three" as a result but the assertions have "one,three,two"
right next to 1,2,3
Please, check this assertions.
Thanks.
Created at: 2017/05/26 15:06; Updated at: 2020/11/17 14:17
The question is resolved.