# Converting degree to radian in JavaScript

JavascriptWeb DevelopmentFront End TechnologyObject Oriented Programming

The radian is the unit for measuring angles and is the standard unit of angular measure used in many areas of mathematics.

We are required to write a JavaScript function that takes in a number that represents some degree and returns its corresponding radian.

## Example

Following is the code −

const deg = 180;
const degreeToRadian = (degree) => {
const factor = (Math.PI / 180);
const rad = degree / factor;
console.log(degreeToRadian(deg));
10313.240312354817