当我添加name属性Object.prototype和引用时Object.prototype,我收到以下错误:
TypeError: Cannot read property '0' of undefined"
Run Code Online (Sandbox Code Playgroud)
但我可以读Object.prototype.name.这个name属性是特别的Object.prototype吗?为什么会出现此错误?
该代码已在Mac OS X上的Node v6.9.5环境中执行.有谁知道如何解决这个问题?
$ node
> Object.prototype
{}
> Object.prototype.value = 'foo';
'foo'
> Object.prototype.name = 'bar';
'bar'
> Object.prototype
TypeError: Cannot read property '0' of undefined
> Object.prototype.name
'bar'
> Object.prototype.value
'foo'
> delete Object.prototype.name
true
> Object.prototype
{ value: 'foo' }
> Object.prototype.name = 'bar';
'bar'
> Object.prototype
TypeError: Cannot read property '0' of undefined
> …Run Code Online (Sandbox Code Playgroud) 我是 Git/GitHub 的新手。
实际上,我知道如何通过 GitHub GUI 界面从 GitHub 上现有的远程分支创建一个新分支,如下所示。
此过程的 CLI(命令行)在下面是否正确?
git checkout -b new_branch_name origin/existing_branch_name_on_git_hub
有没有人告诉我具体的方法?