prototype = provide ability for adding new methods or class (Example- Inherit)
1) Home.js
2) addition.js
o/p ->
this is addition module
20
prototype = provide ability for adding new methods or class (Example- Inherit)
1) Home.js
2) addition.js
o/p ->
this is addition module
20
var name ="kamal"
class users{ ///creteing class
ECMA Concept
-> 'let ' is an scope varible it can't be use as globle varible
-> if we'r using 'var' in place of let it will re-assign last defined value (means
var a = 30
var a = 30
console.log("value of a is:"+a)
OUTPUT-
value of a is = 30
)
if we are using 'let' inplace of var then it look like
let a=40;
let a=30;
OUTPUT
SyntaxError: Identifier 'a' has already been declared
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
let a=30;
output-
value of a under function :40
value of a:30
module exports
->it will help to get/fetch one module data into another module
main.js
global_object.js
OUTPUT-
K:\NodeJs\Node Basics\chapter-1
K:\NodeJs\Node Basics\chapter-1\globalObject.js
Kamal
Global Objects
-> We have two js files for accessing main.js objects we are using this functions in object.js
1)main.js
2)global_objects.js
Anonymous Functions
-> define variable then function
Ex.- !) Without parameter....
ver kamal = function(){
console.log("Its a anontmous function");
}
kamal() ///call functions
!!) With parameter...
var kamal = funtion(a,b){
var c = a+b
console.log("The value of c is : "+c)
}
kamal(5,5) //call functions
OUTPUT - The value of c is :10
NOTE: There is no name infront of function thats why its a anonymous function.
Rxjava - Observer - Based on data view willl render (react) karega. trotling -> making stream for execution (Means clicks event fire kr...