(十)JavaScript学习笔记 - 函数(续)

(10)JavaScript学习笔记 - 函数(续)一、作为数据的函数//this 用来调用方法的对象成为关键字this的值var ca

(10)JavaScript学习笔记 - 函数(续)

一、作为数据的函数

//this 用来调用方法的对象成为关键字this的值var calculator={operand1:1,operand2:1,compute:function(){this.result=this.operand1+this.operand2;}};calculator.compute();print(calculator.result);