Five powerful JavaScript array methods. Taslan Graham on June 08, 2020 Full article can be found here. Arrays are very common data structures in programming and is supported by many modern programming languages. In ge... Read full post Submit Preview Dismiss Collapse Expand Saurabh Sharma Saurabh Sharma Saurabh Sharma Follow Fullstack Web developer. Location Delhi, India Work Fullstack Web Developer at Codeword Tech Joined Nov 13, 2017 • Jun 9 '20 Dropdown menu Copy link Hide Array(10).fill(null).map(_, i => i) Enter fullscreen mode Exit fullscreen mode This creates an array of the given range 10 in this case. I use this all the time Collapse Expand Carlos Riera Carlos Riera Carlos Riera Follow Joined Dec 19, 2018 • Jun 9 '20 Dropdown menu Copy link Hide Shorter alternative :) [...Array(10).keys()] Enter fullscreen mode Exit fullscreen mode Collapse Expand Saurabh Sharma Saurabh Sharma Saurabh Sharma Follow Fullstack Web developer. Location Delhi, India Work Fullstack Web Developer at Codeword Tech Joined Nov 13, 2017 • Jun 9 '20 Dropdown menu Copy link Hide Oh nice, Collapse Expand Taslan Graham Taslan Graham Taslan Graham Follow Taslan Graham is a web developer with interest in the JavaScript language and JS based technologies and frameworks. Email gtaslan1@gmail.com Location Kingston, Jamaica Education Bsc. Univeristy of Technology, Jamaica Work Software Engineer | Web Developer Joined Jun 5, 2020 • Jun 9 '20 Dropdown menu Copy link Hide Wow! I've never used this before. Will give it a try soon. Collapse Expand Wojciech Dasiukiewicz Wojciech Dasiukiewicz Wojciech Dasiukiewicz Follow I am a full stack developer @ Axel Ringier Springer Tech. I love technology especially JavaScript but PHP and Python are nice too. If you need a help please let me know. Email wojtek@octocode.pl Location Cracow, Poland Work Engineer at Axel Ringier Springer Tech Joined Mar 2, 2020 • Jun 8 '20 Dropdown menu Copy link Hide For me, one of the top useful functions from Array object is Array.from(). You can transform for example NodeList to regular Array of Objects Collapse Expand James Thomson James Thomson James Thomson Follow Just another front-end web dev junkie Location Australia Work Senior Frontend Engineer at Complish Joined Feb 22, 2019 • Jun 8 '20 Dropdown menu Copy link Hide You can transform for example NodeList to regular Array of Objects You can also do this using the ES6 spread operator, e.g. const arr = [...document.querySelectorAll('div')]; Collapse Expand Evgeniy Viniychuk Evgeniy Viniychuk Evgeniy Viniychuk Follow I'm a Software Engineer with 7 years of experience Location Kyiv, Ukraine Education Masters Degree in Computer Engineering Work Software Engineer at ButterflyMX Joined Feb 23, 2020 • Jun 15 '20 Dropdown menu Copy link Hide I guess we also shouldn't forget about some and every methods, they give you a great possibility to check complex conditions and are useful sometimes. Collapse Expand Ricardo Moreira Ricardo Moreira Ricardo Moreira Follow Creating BizBox 🖥️🍃 Coding ⌨️ Food 🥘Entrepreneurship 📚 https://twitter.com/mugas11 Location Helsinki Work Freelance developer at Good Stuff Creations Joined Feb 17, 2019 • Jun 16 '20 Dropdown menu Copy link Hide Good post Taslan Collapse Expand Taslan Graham Taslan Graham Taslan Graham Follow Taslan Graham is a web developer with interest in the JavaScript language and JS based technologies and frameworks. Email gtaslan1@gmail.com Location Kingston, Jamaica Education Bsc. Univeristy of Technology, Jamaica Work Software Engineer | Web Developer Joined Jun 5, 2020 • Jun 17 '20 Dropdown menu Copy link Hide Glad that you liked it, Ricardo Collapse Expand AnselmeGildas AnselmeGildas AnselmeGildas Follow Joined Dec 8, 2021 • Dec 23 '21 Dropdown menu Copy link Hide Salut avec quoi (quelle application) vous réalisez les créas pour présenter les bouts de code. Collapse Expand naveenkumar337 naveenkumar337 naveenkumar337 Follow Joined Apr 6, 2020 • Jun 9 '20 Dropdown menu Copy link Hide This is great article, to explain mostly used Array methods Collapse Expand Taslan Graham Taslan Graham Taslan Graham Follow Taslan Graham is a web developer with interest in the JavaScript language and JS based technologies and frameworks. Email gtaslan1@gmail.com Location Kingston, Jamaica Education Bsc. Univeristy of Technology, Jamaica Work Software Engineer | Web Developer Joined Jun 5, 2020 • Jun 9 '20 Dropdown menu Copy link Hide Glad that you found it useful! Code of Conduct • Report abuse
This creates an array of the given range
10in this case. I use this all the timeShorter alternative :)
Oh nice,
Wow!
I've never used this before. Will give it a try soon.
For me, one of the top useful functions from Array object is Array.from(). You can transform for example NodeList to regular Array of Objects
You can also do this using the ES6 spread operator, e.g.
const arr = [...document.querySelectorAll('div')];I guess we also shouldn't forget about some and every methods, they give you a great possibility to check complex conditions and are useful sometimes.
Good post Taslan
Glad that you liked it, Ricardo
Salut avec quoi (quelle application) vous réalisez les créas pour présenter les bouts de code.
This is great article, to explain mostly used Array methods
Glad that you found it useful!