Tag:org Regular expression div sort data func write greater than string array
The filter () method filters the array, generating a new set of var aqinewdata = Aqidata.filter (function (data) {return data[1]>60;}); Make a new array of data greater than 60. The sort () method sorts the new array from large to small. Aqinewdata.sort (function (A, b) {return b[1]-a[1];}); If replaced by a[1]-b[1] is from small to large sort. The Createdocumentfragment () method of creating virtual (fragmented) nodes makes it more secure to change the structure and nodes of the document. This node is then appended to the parent node. The Replace (A, B) method is used to replace characters with some characters in a string, or to replace a substring that matches a regular expression. Replacing a with B,ab can be a string. The split () method is used to split a string into an array of strings. <script type= "Text/javascript" >var str= "How is you doing today?" document.write (Str.split ("") + "<br/>") document.write (Str.split ("") + "<br/>") document.write (str.split ("", 3)) </script> output results: How,are,you,doing,today? H,o,w,, A,r,e,, Y,o,u,, D,o,i,n,g,, T,o,d,a,y,? The How,are,you Join () method is used to put all the elements in an array into a string. The elements are delimited by the specified delimiter. <script type= "Text/javascript" >var arr = new Array (3) arr[0] = "George" arr[1] = "John" arr[2] = "Thomas" Document.writ E (Arr.join ()) </script> output: george,john,thomas If you change to join ("), the output is George John Thomas.
JS bits and pieces of knowledge