Last active
January 18, 2023 14:20
-
-
Save AsadSaleh/1166027a3e3e9194f49c79c9a6445139 to your computer and use it in GitHub Desktop.
Gasssss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Buat fungsi "plusOne" yang menghasilkan 1 + input yang diberikan. | |
function plusOne(input) { | |
return; // todo | |
} | |
console.log(plusOne(1)); | |
console.log(plusOne(2)); | |
console.log(plusOne(5)); | |
// 2. buat fungsi "minusOne" yang menghasilkan input - 1. | |
function minusOne(input) { | |
return; // todo | |
} | |
console.log(minusOne(1)); | |
console.log(minusOne(2)); | |
console.log(minusOne(5)); | |
// 3. Buat fungsi "double" yang menghasilkan 2 x input yang diberikan. | |
function double(input) { | |
return; // todo | |
} | |
console.log(double(1)); | |
console.log(double(3)); | |
console.log(double(10)); | |
// 4. Buat fungsi "isBiggerThanFive" yang menghasilkan true apabila input besar dari 5. | |
function isBiggerThanFive(input) { | |
return; // todo | |
} | |
console.log(isBiggerThanFive(1)); | |
console.log(isBiggerThanFive(3)); | |
console.log(isBiggerThanFive(10)); | |
// 5. Buat fungsi getName yang mengambil property "name" dari iput | |
// yang berbentuk object { name, power }. | |
function getName(inputObject) { | |
return; // todo | |
} | |
console.log(getName({ name: "asad", power: 60 })); | |
console.log(getName({ name: "mike tyson", power: 100 })); | |
console.log(getName({ name: "batman", power: 99 })); | |
// 6. Buat fungsi "isStrong" yang menghasilkan true apabila input yang berupa | |
// object { name, power } memiliki power lebih besar dari 80 (dan false kalau <= 80). | |
function isStrong(inputObject) { | |
return; // todo | |
} | |
console.log(isStrong({ name: "mike tyson", power: 100 })); | |
console.log(isStrong({ name: "manusia biasa", power: 50 })); | |
console.log(isStrong({ name: "tentara", power: 85 })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment