admin管理员组文章数量:1287624
Actually, I'm doing a script which removes row duplicates from an array. And it works properly, but I don't know why :) Here is a string of my code:
if (refValues[i].join() == uniqueAddrs[n].join())
Actually, I'm doing a script which removes row duplicates from an array. And it works properly, but I don't know why :) Here is a string of my code:
if (refValues[i].join() == uniqueAddrs[n].join())
Share
Improve this question
edited Feb 13, 2015 at 14:17
Cameron Roberts
7,3771 gold badge22 silver badges34 bronze badges
asked Feb 13, 2015 at 8:44
Oleg DatsenkoOleg Datsenko
791 gold badge1 silver badge8 bronze badges
2 Answers
Reset to default 5It's worth mentioning that .join() is actually a core Javascript method, not a Google Apps Specific one.
You can see the documentation here: https://developer.mozilla/en/docs/Web/JavaScript/Reference/Global_Objects/Array/join
refValues
and uniqueAddrs
are array variables, and join() method just concatenates all elements in these arrays to a string. This is a quick and dirty way to check string arrays for equality.
本文标签: javascriptWhat join() method does in Google App ScriptStack Overflow
版权声明:本文标题:javascript - What .join() method does in Google App Script? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741318083a2372038.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论