javascript - js array finds elements by index and returns
为情所困
为情所困 2017-05-19 10:37:33
0
4
539

js array Find the element by index and return the element

为情所困
为情所困

reply all(4)
世界只因有你

Array.prototype.itemOf = function(index) {

for (var i = 0; i < this.length; i++)
{

if (i === index)
{
    return this[i];
}

}
return -1;
};

为情所困

arr[index], put the index in square brackets to directly access the relevant elements. Is that what you're asking?

習慣沉默

Can you be more specific?

阿神

Need to find it?
?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!