filmov
tv
Array some Method in JavaScript | JavaScript Array Methods | Beginners tutorial
![preview_player](https://i.ytimg.com/vi/4ZGvyvKrAp8/maxresdefault.jpg)
Показать описание
🎁 Join my channel to get access to perks:
🧡 Hello All JavaScript Lovers Outhere!
Today you're going to learn about the Array Object In JavaScript.
This tutorial is a series of videos, in each video we will discuss a method (or more) of the Array Object in JavaScript.
In today's video, you're going to learn about the some method.
The some() method checks if any array elements pass a test (provided as a callback function).
The some() method executes the callback function once for each array element.
The some() method returns true (and stops) if the function returns true for one of the array elements.
The some() method returns false if the function returns false for all of the array elements.
The some() method does not execute the function for empty array elements.
The some() method does not change the original array.
🔷 Syntax :
// Callback function
some(callbackFn)
some(callbackFn, thisArg)
// Inline callback function
some(function(element) { /* … */ })
some(function(element, index) { /* … */ })
some(function(element, index, array){ /* … */ })
some(function(element, index, array) { /* … */ }, thisArg)
🔹callbackFn : Function to execute on each element.
The function is called with the following arguments:
🔹element : The current element being processed in the array.
🔹index : The index of element in the array.
🔹array : The array forEach() was called upon.
🔹thisArg (Optional) : Value to use as this when executing callbackFn.
🌍 Social Media Links.
💲 Suppport the Channel
🧡 Hello All JavaScript Lovers Outhere!
Today you're going to learn about the Array Object In JavaScript.
This tutorial is a series of videos, in each video we will discuss a method (or more) of the Array Object in JavaScript.
In today's video, you're going to learn about the some method.
The some() method checks if any array elements pass a test (provided as a callback function).
The some() method executes the callback function once for each array element.
The some() method returns true (and stops) if the function returns true for one of the array elements.
The some() method returns false if the function returns false for all of the array elements.
The some() method does not execute the function for empty array elements.
The some() method does not change the original array.
🔷 Syntax :
// Callback function
some(callbackFn)
some(callbackFn, thisArg)
// Inline callback function
some(function(element) { /* … */ })
some(function(element, index) { /* … */ })
some(function(element, index, array){ /* … */ })
some(function(element, index, array) { /* … */ }, thisArg)
🔹callbackFn : Function to execute on each element.
The function is called with the following arguments:
🔹element : The current element being processed in the array.
🔹index : The index of element in the array.
🔹array : The array forEach() was called upon.
🔹thisArg (Optional) : Value to use as this when executing callbackFn.
🌍 Social Media Links.
💲 Suppport the Channel
Комментарии