Skip to content

Instantly share code, notes, and snippets.

@fidilius
fidilius / gist:6b37863439d98b94bfe8080d9930092a
Created May 29, 2023 14:04
tugas day 5 - sesi 1 (asynchronous)
const user = [
{ id: 1, username: "lala", address: "jakarta" },
{ id: 2, username: "lili", address: "surabaya" },
]
const transaction = [
{
userId: 1,
transaction: [
{ id: 1, status: "Selesai" },
@fidilius
fidilius / gist:e8e09686b1c7d7fd97eba9f5793d8c90
Last active May 23, 2023 08:44
sesi 2 - algoritma budget rumah
// test case
const jumlahRumah = Math.floor((Math.random() * 5) + 1)
const hargaRumah = []
for(let j = 0; j < jumlahRumah; j++) {
hargaRumah[j] = Math.floor((Math.random() * 100) + 1)
}
const budget = Math.floor((Math.random() * 500) + 1)