javascript best way to split an array into two by delimiter -


मेरे पास जावास्क्रिप्ट में एक सरणी है:

  a = ["jhgkhjgk3j_jhgkjhgk", "8797823_0120120   

मुझे मिलना है

  b = ["jhgkhjgk3j", "8797823", "आहा"]   

और

  सी = ["jhgkjhgk", "0120120", "बीबीबी"]  "_"  सीमांकक के कारण   

क्या के लिए बिना उपयोग किए जाने का कोई तरीका है लूप स्टेटमेंट?

बस मस्ती के लिए, यहां एक ECMAScript 6 समाधान है।

 < कोड> दो [बी, सी] = ए.राइड (फ़ंक्शन (रेस, एस, आई) {[रिस [0] [आई], रिज़ [1] [आई]] = एस.एस.प्रॉप ("_"); वापसी res;}, [[], []]);   

फ़ायरफ़ॉक्स में आज काम करेगा, और उम्मीद है कि बहुत दूर के भविष्य में अन्य ब्राउज़रों में भी।

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -