I have the following snippet of JS
var Customer : function()
{
this.ShipProduct : function()
{
//Logic for shipping product. If shipping successful, notify user
//Here I am trying to call Notify
//this.Notify(); // does not work
}
this.Notify = function()
{
//Logic for notify
}
}
How would I call Notify from ShipProduct?
That is not JS, that is a collection of syntax errors.
Use
=when assigning variables, and:inside simple objects, don’t confuse simple objects and functions, don’t forget commas, and don’t prefix property names withthis..