Array some Method in JavaScript | JavaScript Array Methods | Beginners tutorial

preview_player
Показать описание
🎁 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
Рекомендации по теме
Комментарии
Автор

🚨 Big Announcement! 🚨

Hey everyone! I've made a big decision for this channel—I've turned off ads on all my videos! That's right, you can now enjoy all my content ad-free! This means I'm earning $0 from ad revenue, but I believe this is the right move to make your viewing experience better.

If you find my content valuable and want to support my work, there are several ways you can help:

Like & Share: Simply liking the video and sharing it with friends helps a lot!
Subscribe & Hit the Bell: Stay updated and never miss a new video.
YouTube Thanks: Use the "Thanks" button below to send a one-time donation.
Join the Channel Community: Get exclusive perks and behind-the-scenes content.

Every little bit counts and goes directly to creating more high-quality content for you all. Thank you so much for your continued support!

Let’s keep growing and learning together! 🌟

CodeExplained
Автор

next one will be reduce ? ^^ thank you!

marcoss