Javascript - Number valueOf() Method

The valueOf() method returns the primitive value of a number.

Description

The valueOf() method returns the primitive value of a number.

Syntax

number.valueOf()

Parameters

None

Return

A Number, representing the primitive value of a number

Example

Return the primitive value of a number:

Demo

var num = 15;
var n = num.valueOf()
console.log(n);

Result