Javascript Concepts
Javascript Concepts
JavaScript
concepts
FOR INTERVIEWS
Arrow functions.
Multi-line Strings.
Promises.
From To
10+ year
Sayan experience
Example :
var x = 2;
function myFunction() {
let x = 1;
Example :
function myFunction() {
declaration/initialization declaration/
initialization
Declaration
a=1:
var a;
it is initialized.
let num;
function func(){
let greeting;
func();
creation time.
type coercion.
cases
For E.g.:
Math.sqrt(-1);
parseInt("Hello");
null undefined
getElementById() Method
getElementsByClassName() Method
getElementsByName() Method
getElementsByTagName() Method
querySelector() Method
querySelectorAll() Method
screen.width
screen.height
screen.availWidth
screen.availHeight
screen.colorDepth
screen.pixelDepth
window.open() Method
window.close() Method
window.moveTo() Method
window.resizeTo() Method
Tutort Benefits
Syntax: Array.pop()
Syntax: Array.map(function(currentValue,
Syntax: Array.reduce(function(total,
Rest parameter ( … ):
parameters.
syntax.
the arguments.
function extractingArgs(...args){
return args[1];
// extractingArgs(8,9,1); // Returns 9
function addAllArgs(...args){
let sumOfArgs = 0;
let i = 0;
sumOfArgs += args[i];
i++;
return sumOfArgs;
Syntax:
function addFourNumbers(num1,num2,num3,num4){
addFourNumbers(...fourNumbers);
console.log(obj1);
console.log(mergedObj);
From To
10+ year
Sayan experience
Syntax:
function.bind(thisArg, optionalArguments)
From To With
10+ year
const john = {
name: 'John',
age: 24,
};
const jane = {
name: 'Jane',
age: 22,
};
function greeting() {
For example:
greetingJohn();
greetingJane();
function and sets the this keyword, call() sets the this
For example:
function greeting() {
const john = {
name: 'John',
age: 24,
};
const jane = {
name: 'Jane',
age: 22,
};
greeting.call(john);
greeting.call(jane);
call() does not create a new function. We are directly setting the
For example:
console.log(lang);
console.log(`${greeting}, I am ${this.name}
const john = {
name: 'John',
age: 24,
};
const jane = {
name: 'Jane',
age: 22,
};
in the future.
Syntax:
Syntax:
console.log(x);
Syntax:
async1(function(){
async2(function(){
async3(function(){
async4(function(){
....
});
});
});
});
requests.
library.
subscriber.next(1);
subscriber.next(2);
subscriber.next(3);
subscriber.complete();
});
observable.subscribe(value => {
console.log(value);
});
Promises Observables
Promise is always
Observable can be either
asynchronous even though it
synchronous or asynchronous
resolved immediately
Cancelled by using
Cannot be cancelled
unsubscribe() method
millisecond delay.
loop continues. This will block the event loop and create
Service Based
Uzeen
Chhabra Company
execution environment.
alteration, etc.
Syntax:
try {
greeting("Welcome");
} catch (err) {
There are 6 different types of error names returned from error object,
Guaranteed
Hiring
Highest
Can be accessed on
Can be accessed on Can be accessed on
both server- side &
client- side only client- side only
client side
From To
Placed with
through Object.prototype.
I got rejected in the Amazon interview. After that, I joined Tutort Academy
for DSA concepts as a working professional. They fulfilled my all
requirements and that is why I am in Microsoft right now. I highly
recommend Tutort Academy for professionals.
Nikesh Bisen
class of functions.
Debouncing Throttling
Syntax:
Syntax:
return function () {
let shouldWait = false;
clearTimeout(timerId);
callback(...args);
timerId = setTimeout(function () {
shouldWait = true;
func.apply(context, args);
setTimeout(() => {
}, delay);
shouldWait = false;
};
}, delay);
} };
Explore More
www.tutort.net
Follow us on