Which of the following JavaScript will create an alert box containing "Hello Eshika P "?

Back to Questions
A)

var Employee = function (firstName, lastName, age) { this.firstName = firstName; this.lastName = lastName; this.age = age;};Employee = new Employee("Eshika", "P", "24");Employee.prototype.SayHello = function () { alert("Hello" + this.firstName + " " + this.lastName);};Employee.SayHello();

B)

var Employee = function (firstName, lastName, age) { this.firstName = firstName; this.lastName = lastName; this.age = age;};Employee = new Employee("Eshika", "P", "24");Employee.SayHello = function () { alert("Hello" + this.firstName + " " + this.lastName);};Employee.SayHello();

C)

var Employee = { firstName: "Eshika", lastName: "P", age:"24"};Employee.SayHello = function () { alert("Hello" + this.firstName + " " + this.lastName);};Employee.SayHello();

D)

var Employee = { firstName: "Eshika", lastName: "P", age:"24"};Employee.prototype.SayHello = function () { alert("Hello" + this.firstName + " " + this.lastName);};Employee.SayHello();

 

Author Explanation :

.

Answers Posted

PostedBy By: Abdul Samad Qureshi, at 02:54 PM on 27-March-2019

Answer Posted:

Explanation: I guess so

Result: Wrong Answer

Back to Questions

© Copyright 1997 - 2019 | www.bestdotnettraining.com | www.deccansoft.com | All Rights Reserved.
 
Bestdotnet google plus
Enquiry Now



Input symbols