Tapas Adhikary
Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source
JavaScript array methods offer plenty to web developers already. The methods like map(), reduce(), filter() , some(), every(), and many more have helped build our JavaScript muscles for better logic and algorithms. The with() method is a relatively n...
blog.greenroots.info5 min read
Immutable Updates: It creates a new array without altering the original, making it useful in state management. Readability: It provides a clean and concise syntax for updating elements at specific indexes. Safer: Since it doesn’t mutate the original array, it reduces the risk of side effects in your code. let arr = [1, 2, 3]; let newArr = arr.with(1, 5); // [1, 5, 3] console.log(arr); // Original array remains [1, 2, 3]
Another helpful method. Thanks for sharing.
i live in Canada a friend introduces me to blank atm card which i got from Davidwilson hackers, i believe him so well not like scammers out there i have withdrew $50000 with this card so i decided to share a testimony if you are interested contact him now for Financial Solutions Davidwilson2284@gmail.com
I like how it allows you to use negative indexes. I'm surprised this is not already a feature in javascript.
I did not know this existed, thank you for the blog post. While I have no use case for this ( for now at least ) I always love learning more about the language I use as my daily driver.
nice piece mate, ty for this. i've always been using map method in scenarios where i prioritizes immutability with some little logic. thanks once again.
Wow... it got featured!!! So Cool.
Great article!! A comment though, when logging out the newArray. Instead of console.log(newNumbers); it should have been console.log(newArray); right?
Wow, this method would be really handy with React. Thanks for sharing, Tapas!
francisco loyola
front end
Can it be used in a project such as Angular +11 ?