push做方法的时候是给从数组最后一个数据开始增加新的数据,但是做为返回值的时候输出的是该数据的长度;
pop做方法的时候是删除数组最后一个数据,做为返回值的时候是输出当前删除数据的值;
例:let xiaolan = ["yellowgreen","18"];
xiaolan.push(1);
console.log(xiaolan); 输出的是["yellowgreen", "18", 1]
let xiaolan = ["yellowgreen","18"];
console.log(xiaolan.push); 输出的是3;
let xiaolan = ["yellowgreen", "18", 1, true, null, undefined];
xiaolan.pop();
console.log(xiaolan); 输出的是["yellowgreen", "18", 1, true, null];
let xiaolan = ["yellowgreen", "18", 1, true, null, undefined];
console.log(xiaolan.pop()); 输出的是undefined;