10 things, You need to know to be a javascript Developer

JavaScript Developer

JavaScript was created in 1995 by Brendan Eich while he was an engineer at Netscape. JavaScript was first released with Netscape 2 early in 1996.

10 Basic knowledge about javascript:

JavaScript number

By the help of Number() constructor, you can create number object in JavaScript. For example:

var n=new Number(value);

JavaScript Array

There are 3 ways to construct array in JavaScript

  1. By array literal
  2. By creating instance of Array directly (using new keyword)
  3. By using an Array constructor (using new keyword)

Javascript Function

Below are the rules for creating a function in JavaScript:

  • Every function should begin with the keyword function followed by,
  • A user defined function name which should be unique,
  • A list of parameters enclosed within parenthesis and separated by commas,
  • A list of statement composing the body of the function enclosed within curly braces {}.

Example:

function multiply(num1, num2)

{

return num1 * num2;

}

JavaScript Objects

JavaScript Map Method

The array elements are traversed from left to right in order, calling the callback function on each element.

var number = [1,2,3,4,5,6,7,8,9,10];


number.map(function(value){
return Math.pow(value,2);
});

console.log(number);

JavaScript indexOf

const numbers = [1, 2, 3, 4, 5]numbers.indexOf(2) 
numbers.indexOf(9)

JavaScript find

const numbers = [1, 2, 3, 4, 5]
const isEven = number => number % 2 === 0
const isLessThanZero = number => number < 0numbers.find(isEven) //=> 2
numbers.find(isLessThanZero) //=> undefined

JavaScript Slice

Note: Original array will not be modified. It will return a new array.

array.slice(start,end)