• Samantha Ming Logo Samantha Ming
  • Tidbits
  • Blog
  • Courses
  • Contact
Samantha Ming Logo
  • Home
  • Tidbits
  • Blog
  • Courses
  • Contact

  • Flexbox30
  • Newsletter
  • About
  • Invite me to speak
  • Become a sponsor

# Convert Array-like to True Array

This is cool! Learning something new @wesbos ES6 course 🔥

const nodeList = document.querySelectorAll('ul li');

// Method 1: Convert to true Array
Array.from(nodeList);

// Method 2: Convert to true Array
[...nodeList];

// Now you can use map and other methods to loop

# Resources

  • Wes Bos: ES6 Array.from() and Array.of()
Next Tidbit
console.table to Display Data
  • Share to Twitter Twitter
  • Share to Facebook Facebook
  • Share to LinkedIn LinkedIn
  • Share to Reddit Reddit
  • Share to Hacker News Hacker News
  • Email Email

Related Tidbits

  • Royal Wedding with Default Parameter

  • How to Get an Object Length in JavaScript

  • JavaScript: Dot Notation vs Bracket Notation

  • 4 ways to convert String to Character Array in JavaScript


Top Tidbits

  • Named Parameters using JavaScript Destructured Objects

    Named Parameters using JavaScript Destructured Objects

  • How to Get an Object Length in JavaScript

    How to Get an Object Length in JavaScript

  • JavaScript Object.fromEntries()

    JavaScript Object.fromEntries()

  • How to Deep Clone an Array in JavaScript

    How to Deep Clone an Array in JavaScript

  • How to Remove Array Duplicates in ES6

    How to Remove Array Duplicates in ES6

  • No Else Return

    No Else Return

  • hi
  • javascript
  • html
  • css
  • vue
  • console
  • array
  • object
  • es6
  • string
  • number
  • code recipes

Courses

  • Flexbox30

    - Learn Flexbox with 30 Code Tidbits ✨

  • CodeTidbits30

    - 30 days of the best JS, CSS, HTML tidbits 🎄

  • Web Basics

    - Web Basics Explained with Tidbits 🍎

  • Pictorials

    - Step by Step Code Tutorials 👣


Top Articles

  • Testing Non-Exported Functions in JavaScript with Rewire

  • Journal Entry #1: Take Action!

  • 3 Tips to Improve Your Programming Skills

  • Building my New Site with VuePress


Fresh Tidbits

  • Code snippet on HTML abbr Tag

    HTML abbr Tag

  • Code snippet on How to Pad a String with padStart and padEnd in JavaScript

    How to Pad a String with padStart and padEnd in JavaScript

  • Code snippet on Avoid Empty Class in Vue with Null

    Avoid Empty Class in Vue with Null

  • Code snippet on Fix Text Overlap with CSS white-space

    Fix Text Overlap with CSS white-space

  • Code snippet on How to Check if Object is Empty in JavaScript

    How to Check if Object is Empty in JavaScript

  • hi
  • Home
  • Tidbits
  • Blog
  • Courses
  • Newsletter
  • About
  • Contact

  • What I use
  • Flexbox30
  • Pictorials
  • Web Basics
  • Invite me to speak
  • Become a sponsor
© Copyright 2022. Samantha Ming