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
const user = [ | |
{ id: 1, username: "lala", address: "jakarta" }, | |
{ id: 2, username: "lili", address: "surabaya" }, | |
] | |
const transaction = [ | |
{ | |
userId: 1, | |
transaction: [ | |
{ id: 1, status: "Selesai" }, |
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
// 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) | |