Created
November 7, 2021 09:51
-
-
Save mandaputtra/80729d47f7971ef69ec68373261bc961 to your computer and use it in GitHub Desktop.
This file contains 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
// print a name | |
function sayHello(name) { | |
console.log(`Hallo ${name} (^▽^)`) | |
} | |
// check if number are odd or even | |
function oddOrEven(num) { | |
if (num % 2 === 0) { | |
console.log('Genab') | |
} else { | |
console.log('Ganjil') | |
} | |
} | |
// be a calculator | |
function areaOfCircle(num) { | |
console.log(Math.PI * num * num) | |
} | |
// program to count the number of vowels in a string | |
function countVowel(str) { | |
// find the count of vowels | |
const count = str.match(/[aeiou]/gi).length; | |
// return number of vowels | |
console.log(count) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment