Skip to main content

Command Palette

Search for a command to run...

Return the Next Number from the Integer Passed

Published
1 min read
Return the Next Number from the Integer Passed
D

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

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));

More from this blog

D

Dipesh Murmu

46 posts

A Full-Stack Laravel Developer with expertise in HTML, CSS, JavaScript, Tailwind, and core PHP. Leveraging the power of Laravel, I specialize in creating dynamic and responsive web applications.