How to Convert Decimal number to hex in JavaScript?

Below is a sample soucrecode snippet demonstrating the conversion of decimal number to hexadecimal in JavaScript.

How to Convert Decimal number to hex in JavaScript?

var hexDecimalString = DecimalNumber.toString(16);
%d