var index = [12, 5, 8, 130, 44].indexOf(130);
document.write("index is : " + index );
var index = [12, 5, 8, 130, 44].indexOf(13);
document.write("<br />index is : " + index );
function isBigEnough(element, index, array) {
return (element >= 10);
}
var retval = [2, 5, 8, 1, 4].some(isBigEnough);
document.write("Returned value is : " + retval );
var retval = [12, 5, 8, 1, 4].some(isBigEnough);
document.write("<br />Returned value is : " + retval );
var myno = new Array("z","c","v","b","f");
//var mylength = myno.push(44);
//document.write("</br>my new array:" + myno)
var myLength = myno.sort();
document.write("<br>sorted array:" + myLength)
var arr = new Array("orange", "mango", "banana", "sugar");
var length = arr.unshift("water");
document.write("</br>Returned array is : " + arr );
document.write("<br /> Length of the array is : " + length );
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.