adplus-dvertising
frame-decoration

Question

Which is the correct code that returns a complex number that is the complex conjugate of this one?

a.

Complex.prototype.conj = function() { return new Complex(this.r, -this.i); };

b.

Complex.prototype.conj = function() { return Complex(this.r, -this.i); };

c.

Complex.prototype.conj = function() { return (this.r, -this.i); };

d.

Complex.prototype.conj = function() { new Complex(this.r, -this.i); };

Posted under JavaScript

Answer: (a).Complex.prototype.conj = function() { return new Complex(this.r, -this.i); };

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which is the correct code that returns a complex number that is the complex conjugate of this one?

Similar Questions

Discover Related MCQs

Q. How can we make methods available on all objects?

Q. What is the procedure to add methods to HTMLElement so that they will be inherited by the objects that represent the HTML tags in the current document?

Q. You can refresh the webpage in JavaScript by using

Q. The functions provide() and require() of Dojo toolkit and Google's Closure library are used for

Q. The maximum number of global symbols a module can define is

Q. To define each of the set classes as a property of the sets object (namespace) for the module, the statement is

Q. Consider the following statement

var Set = sets.Set;
var s = new Set(1,2,3);

What could be the efficiency quotient of the above two statements ?

Q. The scope of a function is also called as

Q. Modules that have more than one item in their API can

Q. The provides() function and the exportsobject are used to

Q. Consider the following code snippet

var sets = com.davidflanagan.collections.sets;

What is the programmer trying to do in the above code snippet?

Q. The properties() method is a

Q. What can be done in order to avoid creation of global variables in JavaScript?

Q. The "$" present in the RegExp object is called a

Q. Consider the following statement containing regular expressions"

var text = "testing: 1, 2, 3";
var pattern = /d+/g;

In order to check if the pattern matches, the statement is

Q. The regular expression to match any one character not between the brackets is

Q. What does /[^(]* regular expression indicate ?

Q. What will be the result when non greedy repetition is used on the pattern /a+?b/ ?

Q. What does the subexpression /java(script)?/ result in ?

Q. What is the most essential purpose of parantheses in regular expressions ?