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
console.log('Tugas1----\n'); | |
function shoutOut() { | |
console.log('Halo Function'); | |
} | |
shoutOut(); | |
console.log('\n\n-----Tugas2----\n'); | |
function calculateMultiply(){ | |
return num1*num2; | |
} |
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
console.log('---Looping---'); | |
console.log('\n---1. Melakukan Looping Menggunakan While---\n'); | |
console.log('Looping Pertama'); | |
var a=20; | |
var i=1; | |
while(i<a){ | |
i= i + 1; | |
console.log(i+' - i love coding'); | |
i++; | |
} |
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
console.log("----1. Let's Form A Setence----\n"); | |
var word = 'JavaScript'; | |
var second = 'is'; | |
var third = 'awesome'; | |
var fourth = 'and'; | |
var fifth = 'I'; | |
var sixth = 'love'; | |
var seventh = 'it!'; | |
console.log(word + ' ' + second + ' ' + third + ' ' +fourth + ' ' +fifth+ ' ' +sixth+ ' ' +seventh); |
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
/// code game proxytia | |
console.log("-----program if else-----\n") | |
var nama = "Nakan"; | |
var peran = "Ksatria"; | |
if (nama == "" && peran ==""){ | |
console.log("Nama Harus diisi!"); | |
}else if (nama == "Nakan" && peran ==""){ | |
console.log(`halo ${nama}, Pilih peran,u dalam memulai game!`); | |
}else if (nama == "Nakan" && peran =="Ksatria"){ |