Updated topic Passing Values to Functions with Arguments

Updated topic Passing Values to Functions with Arguments
0.0 0

#1

Tell us what’s happening:

Hi, can someone please take a look at this javascript challenge Passing Values to Functions with Arguments??

Your code so far


// Example
function ourFunctionWithArgs(a, b) {
  console.log(a - b);
}
ourFunctionWithArgs(10, 5); // Outputs 5

// Only change code below this line.

function functionWithArgs(1, 2) {
  console.log(1 + 2);
}
functionWithArgs(1, 2);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments


#2

try replacing (1,2) and (1+2); with some words. for example

function functionWithArgs(arg1 ,arg2){
  console.log(arg1 + arg2)
}

An explanation is describe in this documentation:
https://www.w3schools.com/js/js_functions.asp