hrpatel


{ City } chennai, tamil nadu
< Country > india
* Profession * hr executive
User No # 125374
Total Questions Posted # 10
Total Answers Posted # 10

Total Answers Posted for My Questions # 10
Total Views for My Questions # 6875

Users Marked my Answers as Correct # 0
Users Marked my Answers as Wrong # 1
Questions / { hrpatel }
Questions Answers Category Views Company eMail

What is MEAN in javascript

1 JavaScript 626

What is Minification

1 JavaScript 661

What is an enum

1 JavaScript 493

How do you extend classes Code snippet: const circle = { radius: 20, diameter() { return this.radius * 2; }, perimeter: () => 2 * Math.PI * this.radius };

1 JavaScript 647

Can you write a random integers function to print integers with in a range?

1 JavaScript 707

What is the output of below code var car = new Vehicle("Honda", "white", "2010", "UK"); console.log(car); function Vehicle(model, color, year, country) { this.model = model; this.color = color; this.year = year; this.country = country; }

1 JavaScript 851

Event handler Example

1 JavaScript 589

What will be the output of the code below? var Y = 1; if (function F(){}) { y += Typeof F; } console.log(y);

1 JavaScript 852

What will be the output of the following code? //nfe (named function expression) var Foo = Function Bar() { return 7; }; typeof Bar();

1 JavaScript 810

What is a “closure” in JavaScript? Provide an example

1 JavaScript 639




Answers / { hrpatel }

Question { 626 }

What is MEAN in javascript


Answer

The MEAN (MongoDB, Express, AngularJS, and Node.js) stack is the most popular open-source JavaScript software tech stack available for building dynamic web apps where you can write both the server-side and client-side halves of the web project entirely in JavaScript.

Is This Answer Correct ?    0 Yes 0 No

Question { 661 }

What is Minification


Answer

Minification is the process of removing all unnecessary characters(empty spaces are removed) and variables will be renamed without changing it's functionality. It is also a type of obfuscation.

Is This Answer Correct ?    0 Yes 0 No


Question { 493 }

What is an enum


Answer

An enum is a type restricting variables to one value from a predefined set of constants. JavaScript has no enums but typescript provides built-in enum support.
enum Color {
RED, GREEN, BLUE
}

Is This Answer Correct ?    0 Yes 0 No

Question { 647 }

How do you extend classes
Code snippet:
const circle = {
radius: 20,
diameter() {
return this.radius * 2;
},
perimeter: () => 2 * Math.PI * this.radius
};


Answer

40 and NaN

Is This Answer Correct ?    0 Yes 0 No

Question { 707 }

Can you write a random integers function to print integers with in a range?


Answer

function randomInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
randomInteger(1, 100); // returns a random integer from 1 to 100
randomInteger(1, 1000); // returns a random integer from 1 to 1000

Is This Answer Correct ?    0 Yes 0 No

Question { 851 }

What is the output of below code

var car = new Vehicle("Honda", "white", "2010", "UK");
console.log(car);

function Vehicle(model, color, year, country) {
this.model = model;
this.color = color;
this.year = year;
this.country = country;
}


Answer

{model: "Honda", color: "white", year: "2010", country: "UK"}

Is This Answer Correct ?    0 Yes 0 No

Question { 589 }

Event handler Example


Answer



DOM!!!






Is This Answer Correct ?    0 Yes 0 No

Question { 852 }

What will be the output of the code below?
var Y = 1;
if (function F(){})
{
y += Typeof F;
}
console.log(y);


Answer

The output would be 1undefined.

Is This Answer Correct ?    0 Yes 0 No

Question { 810 }

What will be the output of the following code?

//nfe (named function expression)
var Foo = Function Bar()
{
return 7;
};
typeof Bar();


Answer

Reference Error

Is This Answer Correct ?    0 Yes 1 No

Question { 639 }

What is a “closure” in JavaScript? Provide an example


Answer

var globalVar = "xyz";

(function outerFunc(outerArg) {
var outerVar = 'a';

(function innerFunc(innerArg) {
var innerVar = 'b';

console.log(
"outerArg = " + outerArg + "
" +
"innerArg = " + innerArg + "
" +
"outerVar = " + outerVar + "
" +
"innerVar = " + innerVar + "
" +
"globalVar = " + globalVar);

})(456);
})(123);

Is This Answer Correct ?    0 Yes 0 No