Javascript Array





What is an Array?


An Array is a list of elements and is similar to a String, but it has length property along with numeric property



Example Code of fromIndex with Array:

				
				
// var arr = ['red', 'blue', 'yellow'];

--> When the default index sets at 0 

	arr.includes('yellow', 3); // false  

	arr.includes('yellow', 100) // false



--> if the computed index is less than 0 
	// array length is 3 
	// fromIndex is -100
	// computed index is 3 + (-100) = 97 

	var arr = ['red', 'blue', 'yellow'];

	arr.includes( 'red', -100); //true 
	arr.includes( 'blue', -100); //true 
	arr.includes( 'yellow', -100); //true 

				
			

Home Page

What are Strings?