Skip to main content

Command Palette

Search for a command to run...

Create a function that takes two numbers as arguments and returns their sum

Published
1 min read
Create a function that takes two numbers as arguments and returns their sum
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 two numbers as arguments and returns their sum

Examples

addition(3, 2) ➞ 5

addition(-3, -6) ➞ -9

addition(7, 3) ➞ 10

Javascript

function sum(p1,p2) {
    return p1+p2;
}
let a=5,b=6;
console.log(sum(a,b));

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.