标签:call nbsp 循环 for console led and inf text
var cats = [‘Bill‘, ‘Jeff‘, ‘Pete‘, ‘Biggles‘, ‘Jasmin‘]; var info = ‘My cats are called ‘; for (var i = 0; i < cats.length; i++) { if (i === cats.length - 1) { info += ‘and ‘ + cats[i] + ‘.‘; } else { info += cats[i] + ‘, ‘; } } console.log(info)
JS for循环实现 My cats are called Bill, Jeff, Pete, Biggles, and Jasmin.
标签:call nbsp 循环 for console led and inf text
原文地址:http://www.cnblogs.com/xzma/p/7655400.html