We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
想問一下昨天導讀的內容 裡面有個範例
let ps = document.querySelectorAll('p'); Array.from(ps).forEach(function (p) { console.log(p); });
Array.from 是用來把物件轉成陣列對吧? document.querySelectorAll 回來的結果不是 陣列嗎? 還是他是類陣列? 還是其實陣列也是類陣列的一種? 為何這邊還需要用 Array.from() 去包 ps? 求解~
The text was updated successfully, but these errors were encountered:
Array.from 可以 each array like 的陣列或是 iterable objects,querySelectorAll 它所回傳的是一個 array like。
Array.from
querySelectorAll
Sorry, something went wrong.
原來如此~ NodeList not an Array https://developer.mozilla.org/zh-TW/docs/Web/API/NodeList
No branches or pull requests
想問一下昨天導讀的內容
裡面有個範例
Array.from 是用來把物件轉成陣列對吧?
document.querySelectorAll 回來的結果不是 陣列嗎?
還是他是類陣列?
還是其實陣列也是類陣列的一種?
為何這邊還需要用 Array.from() 去包 ps?
求解~
The text was updated successfully, but these errors were encountered: