Skip to content

Instantly share code, notes, and snippets.

@krisnachy
Created March 7, 2021 23:51
Show Gist options
  • Save krisnachy/96dcc98b801afccdd4f5aeaede819c22 to your computer and use it in GitHub Desktop.
Save krisnachy/96dcc98b801afccdd4f5aeaede819c22 to your computer and use it in GitHub Desktop.
//Multiline String
const string = `
satu
dua
tiga`
console.log(string)
//Penyisipan
const myWork = 'ES6'
const work = `Sedang mengerjakan tugas ${myWork}`
//Let dan Const
let test = 'Latihan'
console.log(test)
test = 'Tugas'
console.log(test) //bisa diubah
const test = 'Latihan'
console.log(test)
test = 'Tugas'
console.log(test) //tidak bisa diubah
//Arrow Function
const lat === test => console.log(test)
//Destructuring
const latihan = {
nama: "Tugas",
materi: "ES6"
}
const { nama, materi } = latihan
console.log(nama)
//Ternary operation
const cek = (2 > 3) ? "Benar" : "salah"
console.log(cek)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment