User:Krankuba

====the simplest, library-free code for implementing array intersections: ==== ​var arr = [1, 2, 3, 4, 5, 6, 7, 9]; var arr2 = [0, 3, 6, 7, 8, 9, 10]; arr.filter(function(n) {    return arr2.indexOf(n) != -1; }); //returns [3, 6, 9]

reverse a string:
var str = "something"; var strReversed = str.split().reverse.join(); //returns strReversed  = gnihtemos

sum all array elements:
var arr = [1, 2, 3, 4]; var arrTotal = arr.reduce(function(previousNum, currentNum) {      return previousNum + currentNum;     }); //returns arrTotal = 10

next item code code code next item code code code next item code code code next item