We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Functions

As you might have guessed, JavaScript supports functions via the function keyword.

Even JavaScript isn't crazy enough to not support functions.

// function declaration
function getSum(a, b) {
  return a + b;
}

// function call
const result = getSum(60, 9);

console.log(result);
// 69

Assignment

We often need to manipulate strings in Textio. For example, adding some personalization by using a customer's name within a template. The concat function should take two strings and combine them together.

  • hello + world = helloworld

Fix the function signature of concat to reflect its behavior.