new operator
【new operator】
  When the code new Foo(...) is executed, the following things happen:
- A new object is created, inheriting from 
Foo.prototype.(即新建对象的 __prototype__ 属性与 Foo.prototype 一样) - The constructor function F
oois called with the specified arguments andthisbound to the newly created object.new Foois equivalent tonewFoo(), i.e. if no argument list is specified, Foois called without arguments. - The object returned by the constructor function becomes the result of the whole
newexpression. If the constructor function doesn't explicitly return an object, the object created in step 1 is used instead. (Normally constructors don't return a value, but they can choose to do so if they want to override the normal object creation process.) 
  You can add a shared property to a previously defined object type by using theFunction.prototype property. This defines a property that is shared by all objects created with that function, rather than by just one instance of the object type. The following code adds a color property with value null to all objects of type car, and then overwrites that value with the string "black" only in the instance object car1.
  
【Function】
  Function objects inherit from Function.prototype.  Function.prototype cannot be modified. In JavaScript every function is actually a Function object.
prototype和__proto__是完全不一样的两个东西。
  
__proto__用于实现继承。
new operator的更多相关文章
- The Safe Navigation Operator (&.) in Ruby
		
The most interesting addition to Ruby 2.3.0 is the Safe Navigation Operator(&.). A similar opera ...
 - Blender 脚本之 Operator 初探
		
addon(插件)用来扩展 Blender 的功能,跟其他软件里的 plugin(插件)一样,去掉不会影响软件的运行.插件可以加到 Blender 的用户偏好设置目录里,或者就在你所编辑的.blend ...
 - Sequence Project Showplan Operator 序列映射运算符
		
Sequence Project Showplan Operator 序列映射运算符 序列映射运算符会从一个已经排序的集合里通过不停添加集合里的列执行计算. 运算符根据一个或多个列的值把输入集合分为多 ...
 - [c++] Operator overloading
		
c++的操蛋属性:自己为一档,空一档,其他随意. UB_stack a; UB_stack b = a; // copy auto c = a; auto d {a}; // (or auto d = ...
 - EC笔记:第二部分:11:在operator=中处理“自我赋值”
		
已经一年半没有写过博客了,最近发现学过的知识还是需要整理一下,为知笔记,要开始收费了以前写在为知笔记上笔记也会慢慢的转到博客里. 话不多说,进入正题. 考虑考虑以下场景: 当某个对象对自身赋值时,会出 ...
 - Swift学习(一):自定义运算符 operator
		
自定义运算符仅能包含这些字符: / = - + * % < >!& | ^.~ 运算符位置: 前置运算符 prefix 中间运算符 infix 后置运算符 postfix 运算符其 ...
 - Bash 4.4 中新增的 ${parameter@operator} 语法
		
Bash 4.4 中新增了一种 ${...} 语法,长这样:${parameter@operator}.根据不同的 operator,它展开后的值可能是 parameter 这个参数的值经过某种转换后 ...
 - 为什么operator>>(istream&, string&)能够安全地读入长度未知的字符串?
		
一般而言,实现"读入用户输入的字符串",程序中自然不能对用户输入的长度有所限定.这在C++中很容易实现,而在C中确没那么容易. 这一疑问,我在刚学C++的时候也在脑中闪现过:不过很 ...
 - tensorflow添加自定义的auc计算operator
		
tensorflow可以很方便的添加用户自定义的operator(如果不添加也可以采用sklearn的auc计算函数或者自己写一个 但是会在python执行,这里希望在graph中也就是c++端执行这 ...
 - Flink – window operator
		
参考, http://wuchong.me/blog/2016/05/25/flink-internals-window-mechanism/ http://wuchong.me/blog/201 ...
 
随机推荐
- selenium APi
			
1.查看浏览器的名字方法:name实例:drvier.name 2.删除浏览器所以的cookies方法:delete_all_cookies()实例:driver.delete_all_cookies ...
 - CefSharp v62修改,支持.net4.0
			
吐槽一下,博客园久了没有上,账号没了,重新申请一个. cesharp v62版本,内核采用最新的Cef 62,支持最新的Grid布局. 由于官方的cefsharp 采用.net4.5.2开发.怎么办怎 ...
 - 1006 Sign In and Sign Out (25 分)
			
1006 Sign In and Sign Out (25 分) At the beginning of every day, the first person who signs in the co ...
 - 自己写的jQuery颜色插件
			
界面效果: 插件js代码: ;(function ($) { //122种颜色 var aColors = [ "ff0000", "ffff00", &quo ...
 - javascript中setInterval制作跑马灯的效果
			
html代码: javascript代码 <script type="text/javascript"> function scroll() { var title = ...
 - SpringBoot入门篇--读取资源文件配置
			
在项目的开发中,我们知道的是SpringBoot框架大大减少了我们的配置文件,但是还是留下了一个application.properties文件让我们可以进行一些配置.当然这些配置必然是包括服务器的配 ...
 - SyntaxError: Non-ASCII character ‘\xe5′ in file
			
在写一个抓取网页的小脚本,运行起来总是出现这个错误 查了下Python的默认编码文件是用的ASCII码,你将文件存成了UTF-8也没用,解决办法很简单 只要在文件开头加入 # -*- coding: ...
 - 20180129周一之学习PYTHON笔记【安装、查看工作目录、】
			
一,安装过程中多选一个ADD的项,免去设置环境变量. 二,PYAUTOGUI模块控制键鼠. IMAGE模块. ----------------------python 如何查看与更换工作目录----- ...
 - Centos7修改profile错误导致命令行不能用,情况的解救方案,dir命令不能用
			
Linux修改profile文件改错了,恢复的方法 Linux修改profile文件改错了,恢复的方法在改profile的时候,改出问题了,除了cd以外的命令基本都不能用了,连vi都不能用了,上网查了 ...
 - hammer使用:  代码:捏合、捏开、图片放大 的一个手机图片“放大缩小可拖动”的小效果
			
hammer.js 的使用. (手机手势插件) 捏合.捏开.图片放大 的一个手机图片“放大缩小可拖动”的小效果. 相关js 到 http://www.bootcdn.cn/ 查找和下载. hamme ...