const str = 'My name is young\nI\'m young';
const str = 'My name is young\r\nI\'m young';
const str = 'My name is young\rI\'m young';
在不同的操作系统,不同的浏览器中显示出来的效果一样吗?
console.log('My name is young\nI\'m young');
console.log('My name is young\r\nI\'m young');
console.log('My name is young\rI\'m young');
在Windows7上的Chrome的console中输出的结果是:
My name is young
I'm young
My name is young
I'm young
My name is youngI'm young
在写代码时,要考虑可能的平台差异性吗?
慕神8447489
相关分类