Add to Array jQuery

后端 未结 4 1416
一生所求
一生所求 2020-12-07 21:32

I know how to initliaize one but how do add I items to an Array? I heard it was push() maybe? I can\'t find it...

4条回答
  •  抹茶落季
    2020-12-07 22:14

    You are right. This has nothing to do with jQuery though.

    var myArray = [];
    myArray.push("foo");
    // myArray now contains "foo" at index 0.
    

提交回复
热议问题