1.class的基本语法
class可以理解为是一个语法糖,将js只能通过构造函数创建实例的方法进行了补充
构造函数:
function Person ({ name, age18 }) {this.name namethis.age age
}
new Person({name: 张三})
Class类:
class Person {con…
Description
There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.
On the third round, you toggle every third bulb (turning on if it’s off or turning off if it’s on). For the ith round, you toggl…