code1var fruit = ['cherries', 'apples', 'bananas'];
fruit.sort();运行后输出结果是var fruit = ['cherries', 'apples', 'bananas']; fruit.sort(); ["apples", "bananas", "cherries"]code2var fruit = ['cherries', 'apples', 'bananas'];
fruit.sort();
console.log(fruit);运行后输出结果还是var fruit = ['cherries', 'apples', 'bananas']; fruit.sort(); ["apples", "bananas", "cherries"]为何不是var fruit = ['cherries', 'apples', 'bananas']; fruit.sort(); ["apples", "bananas", "cherries"]["apples", "bananas", "cherries"]
添加回答
举报
0/150
提交
取消