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 # 8542

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 757

What is Minification

1 JavaScript 843

What is an enum

1 JavaScript 657

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

1 JavaScript 795

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

1 JavaScript 860

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 1187

Event handler Example

1 JavaScript 706

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

1 JavaScript 999

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

1 JavaScript 965

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

1 JavaScript 773




Answers / { hrpatel }

Question { 757 }

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 { 843 }

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 { 657 }

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 { 795 }

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 { 860 }

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 { 1187 }

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 { 706 }

Event handler Example


Answer



DOM!!!






Is This Answer Correct ?    0 Yes 0 No

Question { 999 }

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 { 965 }

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 { 773 }

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