为了账号安全,请及时绑定邮箱和手机立即绑定

问题:js可迭代对象

问题:js可迭代对象

无无法师 2017-08-23 09:32:38
/*  * Programming Quiz: Make An Iterable Object  *  * Turn the `james` object into an iterable object.  *  * Each call to iterator.next should log out an object with the following info:  *     - key: the key from the `james` object  *     - value: the value of the key from the `james` object  *     - done: true or false if there are more keys/values  *  * For clarification, look at the example console.logs at the bottom of the code.  */ const james = {     name: 'James',     height: `5'10"`,     weight: 185 }; // let iterator = james[Symbol.iterator](); // // console.log(iterator.next().value); // 'James' // console.log(iterator.next().value); // `5'10` // console.log(iterator.next().value); // 185上面这个问题{}不会做,但是[]的会做,如下图
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1996 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号