JavaScript Number toExponential() method

The JavaScript number toExponential() method is used to get the string that represents the exponential notation of a number.

Syntax:

Number.toExponential(n)

Parameters
n: It represents the number of digits after the decimal point. It is an optional parameter.

Returns
Exponential notation of a number as string.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var n= 12.334;
document.writeln(n.toExponential());
</script>
</body>
</html>