Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Using Functions | Functions
JavaScript Ninja
course content

Kursusindhold

JavaScript Ninja

JavaScript Ninja

1. Basic Controls
2. Advanced Controls
3. Functions
4. Loops
5. If-Else Statements
6. Challenges
7. Array

book
Using Functions

Why Use Functions?

Repeating code makes programs long and hard to maintain. Functions let you group commands into a reusable block, reducing repetition and making your code cleaner.

To call a function, simply use its name followed by parentheses, placing any required arguments inside those parentheses. For example, if you have a function named greet that takes a name of a person to greet, here is how you could call it:

javascript
Opgave

Swipe to start coding

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 1
js

ninja.js

toggle bottom row

book
Using Functions

Why Use Functions?

Repeating code makes programs long and hard to maintain. Functions let you group commands into a reusable block, reducing repetition and making your code cleaner.

To call a function, simply use its name followed by parentheses, placing any required arguments inside those parentheses. For example, if you have a function named greet that takes a name of a person to greet, here is how you could call it:

javascript
Opgave

Swipe to start coding

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 1
Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Vi beklager, at noget gik galt. Hvad skete der?
some-alt