If we want to access a character of the string we can access it in two ways.
const first= firstString // return J
const charfirst = firstString.charAt(1) // return a
Concat method: concat is applied to merge two or more strings together .
const first =” hello”;
const second = “there”;
const final = concat(first,second);
console.log( “Concating two strings” + first + “ ” +second);
Returns the first appearance of a string in another string.
const searchIndex = firstString.indexOf(“is”); // return 11
array.concat() method is used to merge two or more arrays and converting a single array without changing the existing arrays. Existing arrays remain the same and return a new array.
Math is built in function that let you do the mathematics in a easier way. You have lots of built in math functions there where you can just put your value and get the output..
Math.abs(x) // returns the absolute value of x
if you put and string in abs function you will get that it is not a number that in NaN
returns the maximum value of the array
similarly Math.min() returns the minimum value of an array or the comparison of two or more numbers
Math.pow(x,y) // return x^y
123 // int type number
123.00 // floating type data
There are methods to make a string a number. That is
Number(‘124’) // returns 124
There are also ceil and floor method
Math.ceil(3/2) // returns 2
precise to the nest integer Number
Math.floor(3/2) //returns 1
precise to the previous int Number
Thank you for reading so far…