scrimba
Yet Another Programming Course
100 - Functions (Part 2)
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

100 - Functions (Part 2)
AboutCommentsNotes
100 - Functions (Part 2)
Expand for more info
index.js
run
preview
console
// Javascript

function sayHello() {
console.log("Hello! I can only say this...");
}

sayHello();

function add3(x, y, z) {
let answer = x + y + z;
return answer; // Can we shorten this?
}

function negate(myInt) {
return myInt * -1;
console.log("This line will never print");
}

// Return two values?
function twoReturns() {
return "First return";
return "Second return";
}

// function areaRect() { }

// function areaTriangle() { }
Console
"15 "
,
/index.html
-13:36