5 important JavaScript methods you should know?
Hello programmers,this is Satyam,founder of BestPythonTutorias.com,again back with another awesome blog and in this blog I am going to discuss the 5 important and useful JavaScript array methods you should know,this method may be known to you but still there will be many programmers that haven't used them so let's get started.Before knowing about these methods you should know about arrays.So arrays are special variable which are used to store multiple values in a single variable.
Filter() method
The filter() method creates an array filled with all array elements that passes particular a test (provided as a function).The filter() method does not execute the function for array elements without values and the original array remains unchanged.
Includes() method
The include() method is used to check if a specific string exists in a collection or not, and returns true
or false
. Keep in mind that it is case sensitive: if the item inside the collection is SAD
, and you search for sad, it will return false
.
Some() method
he every()
method loops through the array, checks every item, and returns true
or false
. Same concept as some()
. Except every item must satisfy the conditional statement, otherwise, it will return false.
Buy Amazon TV fire stick:https://amzn.to/37fADnj
Thanks for Reading
No comments: