10 Methods That Every JavaScript Developer Should Know

  1. Declare an Array
let arr = new Array()orlet  arr = [];
Array.isArray(languages);
let bookName = ‘Learn Js in 10 Days’;
console.log(bookName.charAt(2)); // prints o
let firstName = 'Abdullah AL';
let lastName = 'Habib';
let fullName = firstName.concat(' ', lastName);
// Output: Abdullah AL Habib
let firstName = 'Abdullah AL';
console.log(firstName.endsWith('al')); //Output: True
let firstName = 'Abdullah AL';
console.log(firstName.toLowerCase()); //Output: abdullah al
let firstName = 'Abdullah AL';
console.log(firstName.toUpperCase()); //Output: ABDULLAH AL
let arr = ['CSE', 'SWE', 'CIS', 'ITM']console.log(arr.indexOf('SWE')); //Output: 1
let arr = ['CSE', 'SWE', 'CIS', 'ITM']
arr.push('MCT')
console.log(arr.length); //Output: 5
let arr = ['CSE', 'SWE', 'CIS', 'ITM']
arr.pop()
console.log(arr.length); //Output: 3

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store