jquery create array
var length = 5;
var array = [];
var i = 0;
for (i = 0; i != length; i++){
array.push(i)
//array.push is used to push a value inside array
}
console.log(array);
//console.log is used to check array value inside your consolevar colors = ['red','blue','green'];
/*// OUTPUT
---------------------------*/
console.log(colors[1]); // Outputs 'blue'var names = ["Sanjith", "Pranav", "Aadya", "Saharsh"]
Also in JavaScript:
- react grid
- angular radio box already showing checked
- set kacgground image js
- find length of longest string in array javascript
- prevent form submission on onsubmit function calls
- classList has class
- javascript can you defer inline
- Aspect Ratio height react
- how to use aos in react
- checking object is empty in JS
- angular scroll to element horizontally
- add new key value pair to object javascript
- lastindexof js
- arrow function
- combine 2 arrays javascript
- javascript palindrome check
- how to use await to console
- npm image to LM hash
- json enum string
- mocha supertest
- import button material ui
- react player disable download
- getelementbyclass
- json property becoming small after retriving from .net core controller