

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Functions
incomplete
2: Function Hoisting
incomplete
3: Unit Test Lessons
incomplete
4: Multiple Return Values
incomplete
5: Functions As Values
incomplete
6: Scope
incomplete
7: Anonymous Functions
incomplete
8: Default Parameters
incomplete
9: Passing by Value
incomplete
10: Immediate Invocation
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
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
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 = helloworldFix the function signature of concat to reflect its behavior.