局中
1 | .parent{ |
或者
1 | .parent{ |
模拟new,创建一个对象并设置原型,调用constructor,并根据返回值判断返回什么
1 | function createInstance(constructor, ...args){ |
如果你想完成整个冲突处理流程,通常要做:
git checkout –theirs pnpm-lock.yaml # 选择使用 “theirs” 版本
git add pnpm-lock.yaml # 标记为已解决
git commit # 完成合并提交(如果是手动合并)
| 命令 | 作用 |
|---|---|
git checkout --ours FILE |
使用当前分支的版本解决冲突 |
git checkout --theirs FILE |
使用合并进来分支的版本解决冲突 |
git add FILE |
标记冲突已解决 |
git commit |
完成合并 |
在shell中查看pnpm-lock.yaml的前10行
head -n 10 pnpm-lock.yaml
配合 cat -n 给每行加上行号再显示前 10 行:
cat -n pnpm-lock.yaml | head -n 10
用function实现继承
1 | function extend(sub, par){ |