-
Notifications
You must be signed in to change notification settings - Fork 0
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
数组去重方法 #16
Comments
二 双重循环+splice
|
单层循环+splice
|
四、单层循环+indexof去重
|
五、利用排序
|
六、includes() 方法用来判断一个数组是否包含一个指定的值,根据情况,如果包含则返回 true,否则返回false。
|
七、利用hasOwnProperty方法会返回一个布尔值,指示对象自身属性中是否具有指定的属性(也就是,是否有指定的键)。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一 es6
方法一
var removeDuplicates = function(nums) { return Array.from(new Set(nums)) };
方法二
The text was updated successfully, but these errors were encountered: