This file contains 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 characters
function abc() { | |
console.log('Calling pr'); | |
pr(); | |
console.log('calling pr2'); | |
pr2(); | |
console.log('checking a '); | |
console.log(a); | |
var a; | |
console.log(a); | |
var d = 5; |
This file contains 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 characters
'use strict'; | |
var globalObj = "Global"; | |
/* | |
global variables are accessible to all functions | |
*/ | |
function abc(){ | |
console.log("Global object is "+globalObj); | |
} | |
abc(); |
This file contains 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 characters
console.log(this); | |
function printThis(){ | |
console.log("Inside printThis"); | |
console.log(this); | |
} | |
function printThisInClosure(){ | |
console.log("Insude PrintThisInClosure"); | |
console.log(this); |
This file contains 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 characters
/* | |
Falsy values : "" , '' , 0 , undefined , null , NaN , false | |
*/ | |
function evalTruth(a) { | |
if (a) { | |
console.log('TRUE'); | |
} else { | |
console.log('FALSE'); | |
} | |
} |
This file contains 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 characters
function print(obj,str){ | |
console.log("Object Name: "+obj.name); | |
console.log("String :"+str); | |
} | |
function changeValue(obj,str){ | |
obj.name="something else"; | |
str= "again something else"; | |
str[0]='0'; | |
} |
This file contains 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 characters
'use strict'; | |
angular.module('angularFlaskServices', ['ngResource']) | |
.factory('Post', function($resource) { | |
return $resource('/api/post/:postId', {}, { | |
query: { | |
method: 'GET', | |
params: { postId: '' }, | |
isArray: true | |
} |
NewerOlder