JavaScript Math exp() Method Last Updated : 18 Apr, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report JavaScript Math.exp() is used to get the value of ep, where p is any given number. The number e is a mathematical constant having an approximate value equal to 2.718. It was discovered by the Swiss mathematician Jacob Bernoulli. 2.718 is also called Euler's number. Syntax: Math.exp(p) Parameter: This method accepts a single parameter p: It can be any number. Return Value: It returns the value of ep, where p is any given number as a parameter. Example: Input : Math.exp(0) Output : 1 Explanation: Here the value of parameter p is 0, So after putting the value 0 instead of p in ep then its value becomes 1. Input : Math.exp(2) Output : 7.38905609893065 Explanation: Here the value of parameter p is 2, So after putting the value 2 instead of p in ep then its value becomes 7.38905609893065. Below example illustrate the JavaScript Math exp() Method: Example 1: JavaScript // Here different values is being taken as // as parameter of Math.exp() function. console.log(Math.exp(0)); console.log(Math.exp(1)); console.log(Math.exp(2)); console.log(Math.exp(-1)); console.log(Math.exp(-7)); console.log(Math.exp(10)); console.log(Math.exp(1.2)); Output1 2.718281828459045 7.38905609893065 0.36787944117144233 0.0009118819655545162 22026.465794806718 3.3201169227365472 Example 2: Here parameter should be a number otherwise it gives an error or NaN i.e, not a number. JavaScript <script> // Here alphabet parameter give error. console.log(Math.exp(a)); </script> Output: Error: a is not defined JavaScript // Here parameter as a string give NaN. console.log(Math.exp("gfg")); OutputNaN Example -3 : If we don't pass any parameter to the method then it will also return NaN. JavaScript // Without passing any parameter console.log(Math.exp()); OutputNaN Supported Browsers: The browsers supported by JavaScript Math.E() function are listed below: Google Chrome 1 and aboveInternet Explorer 3 and aboveEdge 12 and aboveFirefox 1 and aboveOpera 3 and aboveSafari 1 and above We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article. Comment More infoAdvertise with us K Kanchan_Ray Follow Improve Article Tags : JavaScript javascript-math Similar Reads JavaScript Tutorial JavaScript is a programming language used to create dynamic content for websites. It is a lightweight, cross-platform, and single-threaded programming language. It's an interpreted language that executes code line by line, providing more flexibility.JavaScript on Client Side: On the client side, Jav 11 min read JavaScript Interview Questions and Answers JavaScript is the most used programming language for developing websites, web servers, mobile applications, and many other platforms. In Both Front-end and Back-end Interviews, JavaScript was asked, and its difficulty depends upon the on your profile and company. Here, we compiled 70+ JS Interview q 15+ min read Introduction to JavaScript JavaScript is a versatile, dynamically typed programming language used for interactive web applications, supporting both client-side and server-side development, and integrating seamlessly with HTML, CSS, and a rich standard library.JavaScript is a single-threaded language that executes one task at 7 min read JSON Web Token (JWT) A JSON Web Token (JWT) is a standard used to securely transmit information between a client (like a frontend application) and a server (the backend). It is commonly used to verify users' identities, authenticate them, and ensure safe communication between the two. JWTs are mainly used in web apps an 7 min read Frontend Developer Interview Questions and Answers Frontend development is an important part of web applications, and it is used to build dynamic and user-friendly web applications with an interactive user interface (UI). Many companies are hiring skilled Frontend developers with expertise in HTML, CSS, JavaScript, and modern frameworks and librarie 15+ min read JavaScript Coding Questions and Answers JavaScript is the most commonly used interpreted, and scripted Programming language. It is used to make web pages, mobile applications, web servers, and other platforms. Developed in 1995 by Brendan Eich. Developers should have a solid command over this because many job roles need proficiency in Jav 15+ min read Top 95+ Javascript Projects For 2025 JavaScript is a lightweight, cross-platform programming language that powers dynamic and interactive web content. From real-time updates to interactive maps and animations, JavaScript brings web pages to life.Here, we provided 95+ JavaScript projects with source code and ideas to provide hands-on ex 4 min read Functions in JavaScript Functions in JavaScript are reusable blocks of code designed to perform specific tasks. They allow you to organize, reuse, and modularize code. It can take inputs, perform actions, and return outputs.JavaScriptfunction sum(x, y) { return x + y; } console.log(sum(6, 9)); // output: 15Function Syntax 5 min read JavaScript Exercises, Practice Questions and Solutions JavaScript Exercise covers interactive quizzes, tracks progress, and enhances coding skills with our engaging portal. Ideal for beginners and experienced developers, Level up your JavaScript proficiency at your own pace. Start coding now! A step-by-step JavaScript practice guide for beginner to adva 3 min read HTML DOM (Document Object Model) The HTML DOM (Document Object Model) is a programming interface that represents the structure of a web page in a way that programming languages like JavaScript can understand and manipulate. Think of it as a tree of objects where each part of your HTML document (elements, attributes, text) is repres 6 min read Like