var str = 'chupacabra';
function reverse(str) {
if (str.length === 0) return '';
var
s1 = str[0],
s = str.slice(1, str.length - 1),
s2 = str[str.length - 1]
return s2 + reverse(s) + s1
}
console.log(reverse(str))
var a = [{
"currentPos": 2,
"isSelected": true,
"text": 4
},
{
"currentPos": 1,
"isSelected": true,
"text": 3
},
{
"currentPos": 3,
"isSelected": true,
"text": 1
}
]
var b = a.every(function(item) {
return item.isSelected
})
console.log(b)