消除第二个字符串数组中的重复项 [英] Elimniate Duplicates in second string array

查看:90
本文介绍了消除第二个字符串数组中的重复项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用JavaScript比较两个字符串数组并消除第二个字符串数组中的常见字符串

How To compare two string arrays and eliminate common strings in second string array Using JavaScript

Eg:- arrCol = {"aa","bb","cc"}
     arrCol1 ={""aa","bb","cc","dd"}
Then output arrCol2={"dd"}


请Giude我.


Please Giude me.

推荐答案

以下是指导:

阅读JavaScript中的''对象''.它们是哈希,哈希是自动重复删除逻辑.
您需要做的就是遍历字符串并将它们分配给对象的键.

试试吧!
Here is the guidance:

Read about ''objects'' in JavaScript. They are Hashes and hashes are an automatic duplicate removal logic.
All you need to do is loop through the strings and assign them to the keys of an object.

Try!


这篇关于消除第二个字符串数组中的重复项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆