(1). A re-introduction to JavaScript(JS tutorial)

Photo by Christopher Robin Ebbinghaus on Unsplash

Javascript was created by brendon Eich in 1995. JavaScript was first published in early 1996 with Netscape 2. It was originally called LiveScript.Several months later, Microsoft released JScript with Internet Explorer 3, which was largely compatible with JavaScript.

(2 ). Overview

JavaScript is a dynamic language with many instances, types and operators, standard built-in objects and methods, its syntax is Java and C language
Many structures of those languages ​​based on are also applied in JavaScript.

Let’s start by looking at building blocks in any language.
JavaScript programs manipulate values ​​and those values ​​are all included in one type, the types of JavaScript are :

Number

String

Boolean

Function

Object

(3). String

String objects are used to represent and manage the order of letters.
Strings are needed to hold data that can be presented in text form

const string1 = “This is a string”

const string2 = ‘This is another string’

const string3 = `This is also another string`

(4). Number

Number is a primitive wrapped object which is 21 or -5.5 etc. It is used to represent and manage the like number. The number contains constants and methods for dealing with construct numbers. Other types of values ​​can be converted to numbers using the number ( ) function. When a number is used as a function, the number (value) converts a string or other value into a type of number.
If the value cannot be converted, it returns ( NaN )

Literal Syntax

525 //five-hundred twenty-five

525.0 //true

525 === 525.0 //true

Function Syntax

Number(‘525’) //returns the number 525

Number(‘525’) === 525 //true

Number(“unicorn”) //NaN

Number(undefined) //NaN

(5). Math

Math is a built-in object that has properties and methods for mathematical constants and functions , It is not a function object.It works with math number type BigInt Doesn’t work with it.

(6). Array

A JavaScript array class is a global object used to create arrays that are list-like objects.

(7). Array.prototype.concat()

The concat () method is used to merge two or more arrays.
This method does not replace existing arrays, instead rendering a new array.

const array1 = [‘a’, ‘b’, ‘c’] ;

const array2 = [‘d’, ‘e’, ‘f’];

const array3 = array1.concat(array2);

console.log(array3);

// expected output ; Array [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’];

(8). Array.prototype.every()

The every () method checks whether all the elements in the array pass the test implemented by the universal function. It provides a Boolean Man.

const isBelowThreshold = (currentValue) => currentValue < 40;

const array1 = [1, 30, 39, 29,10, 13];

console.log(array1.every(isBelowThreshold))

//expected output : true

(9). Array.prototype.filter()

The filter () method creates a new array with all the elements that pass the test applied by the given function.

const numbers = [32, 33, 16, 40]

const result = numbers.filter(number => number > 18)

console.log(result);

//expected output : Array [32, 33, 40]

(10). SSL

SSL is a security technology. It is a protocol for servers and web browsers that ensures that the data passed between the two is private.