Created
April 15, 2016 02:33
Revisions
-
chaffeqa created this gist
Apr 15, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ function meth1(){ return 1; } function meth2(input){ return 2 + input; } function result(arg1, cb){ var result = typeof(cb) == "function" && cb(arg1) return result } console.log('a'+result(1,meth1())) console.log('b'+result(1,meth1)) console.log('C'+result(1,meth2)) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ (function() { var a = b = 5; })(); console.log(b); // What will be printed on the console? (function(a,b,c) { console.log(a,b,c) })(window, document); // What will be printed on the console? (function f(f){ return typeof f(); })(function(){ return 1; }); // what is the result? This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ var fullname = 'John Doe'; var obj = { fullname: 'Colin Ihrig', prop: { fullname: 'Aurelio De Rosa', getFullname: function() { return this.fullname; } } }; console.log(obj.prop.getFullname()); var test = obj.prop.getFullname; console.log(test()); // What is the result of the following code?