square(width,function (data) { console.log(data.squareVal); }); exports.square = function(width,callback) { var aa = new Object(); callback(aa.squareVal = width * width); } var s = new square(5); console.log(s);
var s = new square(5, function(result){ console.log(result); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)