Skip to content
New issue

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

array 空位 empty #72

Open
Huauauaa opened this issue Mar 9, 2023 · 0 comments
Open

array 空位 empty #72

Huauauaa opened this issue Mar 9, 2023 · 0 comments
Labels

Comments

@Huauauaa
Copy link
Owner

Huauauaa commented Mar 9, 2023

数组的空位

数组的空位指的是:数组的某一个位置没有任何值。
如:Array构造函数返回的数组是空位。

  • 注意:空位不是undefined,空位是没有任何值empty.
  • in方法:可以用来于检查某个位置是不是空位,返回布尔值。
  • 注意:forEach,filter,some,every方法都会跳过空位,map方法也会跳过空位,但是也会保留这个值。
  • join()和toString()会将空位视为undefined,而undefined和null会被处理为空字符串。
  • 在ES6中,明确将空位转为undefined

Sent from PPHub

@Huauauaa Huauauaa added the js label Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant