Capítulo 146 de 411

Chapter 146: gsap.utils.toArray()

Core Idea

toArray() converts selector text, a NodeList, a single object, or any array-like structure into a flat real Array.

Reference Tables

ParameterTypeDescription
valueString | Array | Object | NodeListwhat to convert
scopeElement(3.7.0+) limits selector-text results to descendants of this element

Code Examples

gsap.utils.toArray(".class"); // Array of matched elements
gsap.utils.toArray(myElement); // Array containing just that one element