//accepts two arrays, returns a difference setfunctionGetdiffset (A, b) {a.sort (charsort); B.sort (Charsort); if(a.length>=b.length) { returnA.slice (b.length)}Else { varArr=[] for(vari=0;i<b.length;i++){
jquery function, returned when not found-1if($.inarray (B[i],a) ==-1) Arr.push (B[i])}returnarr}} Alphabetical orderfunctionCharsort (A, b) {returnA.charcodeat ()-b.charcodeat (); }
In addition, the grouping regular in JS does not return all, it needs a while loop to return all occurrences ... Keng
// Regular Expressions get all the @{} // match all the strings, JS is not able to return all,,, pit dead--- var re=/@{([a-z]{1})}/g; var arr=[]; while (R = re.exec (editortext)) { Arr.push (r[1]); }
The JS replace method does not work on itself and requires a value to receive it: No matter what language is the same.
JS return difference Set