缔造

Results 17 comments of 缔造

```js let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; function observe(arr) { const proxy = new Proxy(arr, { get(target, key) { let v = target[key]; if...

```js let a = [11, 42, 23, 4, 5, 6, 4, 5, 6, 11, 23, 42, 56, 78, 90]; function dengfenthere(arr) { let result = Array.from({ length: 3 }, ()...

```js function isTuofeng(str, judge) { let reg = /[A-Z]/g; let st = str.match(reg).join(""); return st === judge; } console.log(isTuofeng("ByteDance", "BD")); console.log(isTuofeng("Bytedance", "BD")); ```

```html 两种方式 Document img { width: 200px; height: 200px; margin: 160px 60px; display: block; } 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

```js function myNew(constructorFn, ...args) { // 1. 创建一个空对象,该对象的原型指向构造函数的 prototype 属性 const obj = Object.create(constructorFn.prototype); // 2. 将这个空对象作为 this 上下文绑定到构造函数上,并传入参数 const result = constructorFn.apply(obj, args); // 3. 如果构造函数返回了一个对象,则返回这个对象;否则返回上面创建的对象 return typeof result...

```js function zipStr(str) { let index = 0; let left = 0; let right = 0; let strs = ""; while (left < str.length) { if (str[left] !== str[right]) {...

```js function strNumber(str) { let reg = /[a-zA-Z]/; let map = new Map(); for (let i = 0; i < str.length; i++) { if (reg.test(str[i])) { if (map.has(str[i])) { let...