多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# Enumeration The `for in` statement can loop over all of the property names in an object. The enumeration will include functions and prototype properties. ~~~ var fruit = { apple: 2, orange:5, pear:1 }, sentence = 'I have ', quantity; for (kind in fruit){ quantity = fruit[kind]; sentence += quantity+' '+kind+ (quantity===1?'':'s')+ ', '; } // The following line removes the trailing coma. sentence = sentence.substr(0,sentence.length-2)+'.'; // I have 2 apples, 5 oranges, 1 pear. ~~~