Return the Next Number from the Integer Passed

Dipesh MurmuDipesh Murmu
1 min read

Create a function that takes a number as an argument, increments the number by +1 and returns the result.

Examples

addition(0) ➞ 1

addition(9) ➞ 10

addition(-3) ➞ -2

Javascript

function convert(a){
    return a+1;
}
let number = -5;
console.log(convert(number));
0
Subscribe to my newsletter

Read articles from Dipesh Murmu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Dipesh Murmu
Dipesh Murmu

I am a Web Developer from Birtamode 1 Jhapa Nepal. As of 2022 i have 3 years of experience in CSS and 1 year of experience in Javascript + 6 Months of Experince in Node.js