$('.start').click(function(){
var obj = {};
obj = getData(obj);
console.log(obj);
})
function getData(obj){
var items = [1,2,3];
var result = 4;
obj = {
items,
result
};
return obj;
}
var arr2 = ['h2', 'h3', 'h3', 'h2', 'h2', 'h2', 'h3', 'h4'];
function setList(arr) {
if (arr.length === 0) return '<ul>\n</ul>';
let fullList = '<ul>\n';
let ends = [];
arr.forEach((w,e) => {
if((arr[e+1]) && (parseInt(w[1]) < parseInt(arr[e+1][1]))){
fullList += `<li>${w}\n<ul>\n`;
ends.push('</ul>\n</li>');
} else if ((arr[e+1]) && (parseInt(w[1]) === parseInt(arr[e+1][1]))) {
fullList += `<li>${w}</li>\n`;
} else {
fullList +=`<li>${w}</li>\n` + ends.join('\n') + '\n';
ends = [];
}
})
fullList = fullList + '</ul>';
return fullList;
}
var f = num => num.map(w => (w % 2 == 0 ? w*2 : w));
f([1,2,3,4,5]) // [1, 4, 3, 8, 5]
var f =_=> {
var num = prompt('Введите числа через запятую');
return num.split(',').map(Number).map(w => (w % 2 == 0 ? w*2 : w))
};
setInterval(_=>{
icons.forEach(function(element, i){
setTimeout(function(){
element.style.color = 'white'
setTimeout(_=>{
element.style.color = 'green'
}, 400)
}, 240 * ++i)
});
}, icons.length*200 + 800)