-
Notifications
You must be signed in to change notification settings - Fork 592
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
关于 arrayEqual 的一些意见。 #1
Labels
Comments
不过对比Lodash.isEqual来说,算是比较浅的比较了 |
这里单纯的想比较一下,两个数组是否相等。是一个浅层次的比较,只比较了数组内第一层元素是否相等。 |
我觉得像 |
@CoderIvan 恩,同意,也推荐这么做。只要能在用的时候,用最高的效率实现出来就是最完美的。封装个人的工具库,更多的是对第三方库功能的补充。看个人需求。 |
@CoderIvan @proYang 好吧,你们都是对的,我一下脑袋抽风了😭 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
不知道主人是想做
shadow equal
还是deep equal
,感觉是两种都想实现,但都实现得不太好。想法如下,如果有错误的还请指出,一起进步哈🙃首先,如果是第一行代码:
这行代码貌似是想来个
shadow equal
,就是只比较两数组引用相等,而不是两个数组的每个值相等。然后呢,后面的几行代码又有点想做
deep equal
的味道,就是比较两个数组每个值都相等,那么他们相等。所以建议写两个
equal
函数:再提一个小建议哈,
JavaScript
中不等应该要坚持使用!==
。(完)
The text was updated successfully, but these errors were encountered: