JavaScript 배열 이중 for 순환

1980 단어 공부 하 다.
이중 for 순환:
    1.  for    :    
        for(var i=0;i<10;i++)//   for    {
            for(var j=0;j<10;j++)//   for   {
                  1;
        }
    }     2;

배열:
        :2   
        1.var arr =[1,2,3,"4",true];
        console.log(arr.length);//            ;
        2.var arr = New Array(1,2,3);

배열 array 방법 (array 속성: length;):
        var arr = [1,2,3,"4",true];

        1.arr.reverse();//  ,       ;
        2.arr.shift();//        ,        length    ;
        3.arr.pop();//      ,        length    ;
        4.arr.unshift();//               .
        5.arr.push();//               .
        6.arr.concat();//               ;
        7.arr.splice(1,3,"a","b");//1         ,3       ,a.b       ;
        8.arr.slice(1,3);1        ,3       ,  3            ;

string 방법 (string 속성 length;):
        var str = ("asdasd1dadasd111dasdasd22dada");
        1.str.charAt();//  string        ;
        2.str.indexOf();//            .
        3.str.lastIndexOf();//               ;
        4.str.substring(1,5);//      1       ,5    (   5     )
        5.str.toupperCase();//             ;
        6.str.toLowerCase();//       ,                .
        7.str.slice(0,-1);//     , substring  end    ;




















  :
var email = "[email protected]";
    if(email.indexOf("@") != -1 && email.indexOf(".") != -1) {
       var eName = email.substring(0, email.indexOf("@"));
        var qq = email.substring(email.indexOf("@") + 1, email.indexOf("."));
       var com = email.substring(email.indexOf(".") + 1, email.length);
       console.log(eName + "@" + qq + "." + com);
   }
    var arr = email.split("@");
    console.log(arr[0] + "@" + arr[1].split(".")[0] + "." + arr[1].split(".")[1]);

좋은 웹페이지 즐겨찾기