mk
Estimated reading time: 2 minutesjasvascript
it is scripting language which alive the html. it’s first name was liveScript . that time java was more popular so named JavaScript. Now no relation with java . javascript - echmaScript age.
Operators
typeof
typeof 54 //number
typeof 'kamal' //number
use strict
This is echmascript 5 feature .
'use strict';
requre
var collect = require(collect.js)
call and apply
// Call() takes comma-separated arguments, ex:
.call(scope, arg1, arg2, arg3)
// and apply() takes an array of arguments, ex:
.apply(scope, [arg1, arg2, arg3])
call
let name = (...t) => {
console.log(t);
}
name.call(name, "kamal","jamal");
// [kamal,jamal]
apply
let name = (...t) => {
console.log(t);
}
name.apply(name, ["kamal","jamal"]);
// [kamal,jamal]
bind
let name = (t,me,...other) => {
console.log(`${t} ${me}`);
console.log(other);
}
let bName = name.bind(name,"I am", "jamal");
bName("kamal","maruf","sadia")
// I am jamal
// [ 'kamal', 'maruf', 'sadia' ]