JavaScript return an anonymous function inside an anonymous function -


Why is an anonymous function returned in getNameFun (see section 1), is it just this.name (see Segment 2)?

Segment 1:

  var name = "window"; An object ???? var object = {single ???? One ???? One ???? Name: "My Object", a ???? ? One ???? One ???? getNameFunc: function () {any one α one relation one return function () a '' a '' a '' '' '' '' '' '' '' '' back '' Ã ???? Ã ???? Ã ???? Ã ???? Ã ???? Ã ????}; One '' a '' a '' '' '' 'a' '????); Ã ???? Ã ???? Warning (object.getNameFunc () ());   

Segment 2:

  var name = "window"; An object ???? var object = {single ???? One ???? One ???? Name: "My Object", a ???? ? One ???? One ???? GetNameFunc: function () {one word does not get a word? A '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' // // is different here! Ã ???? Ã ???? Ã ???? Ã ???? Ã ???? Ã ???? One '' one '' '' '' '' '' a ''); Ã ???? Ã ???? Warning (object.getNameFunc ());    

Try it like this

  var Myclass = function () {var itself = this; Self.Name = "My Object"; Self.getNameFunc = function () {returns self Name;}} var myc = new myclass (); Warning (myc.getNameFunc ());   

Here's a bell to help



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -