Peer-reviewed code snippets that anyone can edit
A wiki for useful code snippets
Array.make - transforms list-like data structures into native arrays
r9 r10
1
Two versions of an **{{Array.make}}** method that handles list-like data structures such as **{{[HTMLCollection]}}**s / **{{[NodeList]}}**s, **{{[String]}}**s or **{{[arguments]}}** -arrays turning them into native array objects.
1
Two versions of an **{{Array.make}}** method that handles list-like data structures such as **{{[HTMLCollection]}}**{{s}} / **{{[NodeList]}}**{{s}}, **{{[String]}}**{{s}} or **{{[arguments]}}** -arrays turning them into native array objects.
2
2
 
3
3
This firstly implemented version creates an {{Array.make}} that will throw a **{{[TypeError]}}** if it got passed invalid arguments whereas the latter in that case will fail silently.
4
4
 
5
5
 
Tags added:
Tags removed: