Steven Lee

Results 9 comments of Steven Lee

太励志了,加油加油。

``` javascript const convert = num => (num / 10) | 0 ? String(num % 10) + convert((num / 10) | 0 ) : String(num) let res = convert(12345) console.log(res)...

> 用 JavaScript 写一个函数,输入 int 型,返回整数逆序后的字符串。如:输入整型 1234,返回字符串“4321”。要求必须使用递归函数调用,不能用全局变量,输入函数必须只有一个参数传入,必须返回字符串。 int型整数也包含负数,发现大多数解法(包括我的)都只考虑传入数值为正数的情况,题干中也没有相关示例,求解 @yygmind

```js const sevenTimes = num => eval(new Array(7).fill(num).join('+')) sevenTimes(10) // 70 ```

> > ```js > > const sevenTimes = num => new Array(7).fill(num).reduce((p,v)=> p+v) > > > > sevenTimes(10) // 70 > > ``` > > you used + , which...

```js function print(n){ setTimeout((() => { console.log(n) return ()=>{} }).call(n,[]), Math.floor(Math.random() * 1000)); } for(var i = 0; i < 100; i++){ print(i); } ```

每次抽奖过后将此次中奖对象从1000人的抽奖池中剔除:smile:

等式的传递性为什么失效了? ``` Foo.prototype.__proto__ === Object.prototype // true Function.prototype.__proto__ === Object.prototype // true Foo.prototype.__proto__ === Function.prototype.__proto__ // false ```

> > 等式的传递性为什么失效了? > > ``` > > Foo.prototype.__proto__ === Object.prototype // true > > Function.prototype.__proto__ === Object.prototype // true > > > > Foo.prototype.__proto__ === Function.prototype.__proto__ // false >...