TypeScript – String Constructor Property
Returns a reference to the String constructor function that created the object. Example var str = new String( "This is string" ); console.log("str.constructor is:" + str.constructor) On compiling, it will…
Returns a reference to the String constructor function that created the object. Example var str = new String( "This is string" ); console.log("str.constructor is:" + str.constructor) On compiling, it will…
The Strings object lets you work with a series of characters. It wraps the string primitive data type with a number of helper methods. Syntax var var_name = new String(string);…
This method returns the primitive value of the specified number object. Syntax number.valueOf() Return Value Returns the primitive value of the specified number object. Example var num = new Number(10);…
This method returns a string representing the specified object. The toString() method parses its first argument, and attempts to return a string representation in the specified radix (base). Syntax number.toString(…
This method returns a string representing the number object to the specified precision. Syntax number.toPrecision( [ precision ] ) Parameter Details precision − An integer specifying the number of significant digits.…
This method converts a number object into a human-readable string representing the number using the locale of the environment. Syntax number.toLocaleString() Return Value Returns a human-readable string representing the number…
This method formats a number with a specific number of digits to the right of the decimal. Syntax number.toFixed( [digits] ) Parameter Details digits − The number of digits to appear…
This method returns a string representing the number object in exponential notation. Syntax number.toExponential( [fractionDigits] ) Parameter Details fractionDigits − An integer specifying the number of digits after the decimal point.…
TypeScript like JavaScript supports numeric values as Number objects. A numbers object converts numeric literal to an instance of the number class. The Numbers class acts as a wrapper and…
Parameters are a mechanism to pass values to functions. Parameters form a part of the function’s signature. The parameter values are passed to the function during its invocation. Unless explicitly…