/** * Created by W.j.chang on 2014/5/23. *///is the method Console.log (Array.isarray (new array)) to interpret the array, Console.log (Array.isarray ([])), var arr = [1,2,3];// Traversal method Arr.foreach (function (v) {console.log (v);}); Console.log ("---------------------");//filter but do not change the original array arr.filter (function (v) {return v < 3;}). ForEach (function (v) {console.log (v);}); Arr.foreach (function (v) {console.log (v);}); Console.log ("---------------------");//Changes but does not change the original array arr.map (function (v) {return v * 3;}). ForEach (function (v) {console.log (v);}); Arr.foreach (function (v) {console.log (v);}); Console.log ("---------------------"); [1,2,3].map (function (v) {return v*2}). ForEach (function (v) {console.log (v);}); /String Console.log ("Hello". Trim ());//JSON processing var obj = Json.parse (' {"A": "B", "C": "D"} '); Console.log (OBJ.A); Console.log ( Json.stringify (obj));//bind changes the reference function a () {This.hello = = "World";} var B = a.bind ({hello: ' world '});//name function name var AA = function Woot () {};console.log (aa.name);