Larik objek Beranda › Forums › Belajar Menjadi Full Stack Web Developer Tingkat Pemula › Larik objek This topic has 5 replies, 4 voices, and was last updated 3 years, 6 months ago by Coach Vincent. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts May 23, 2022 at 3:34 PM #50249 Tufel ShobrunParticipant Halo kak Untuk yg larik object itu agar kluar hasil ny Sperti yang brada di materi itu gmna cara console.log nya ya ? June 10, 2022 at 3:15 PM #50570 Coach VincentModerator contoh: var items = [ { id: 1, name: ‘abc’ } ] console.log(items) console.log sesuai nama var nya September 3, 2022 at 10:10 PM #130884 jhonatanhasiansiahaanParticipant var items =[ { name : “Asus”, type : “Laptop”, price : 75000000 }, { name : “Dell”, type : “Laptop”, price : 70000000 }, { name : “Corsair”, type : “Ram”, price : 12500000 } ]; function ubahKeArrayObjek(array2D){ var hasil = []; var tempObj = {}; for(var i=0; i<array2D.length; i++){ tempObj.name = array2D[i][0]; tempObj.type = array2D[i][1]; tempObj.price = array2D[i][2]; hasil.push(tempObj); tempObj = {}; } return hasil; } PERTANYAAN : GIMANA CARA MENJALAN KAN UNTUK FUNCTION OBJEK SEPERTI INI? October 13, 2022 at 7:09 PM #170269 Coach VincentModerator invoke function atau call function sesuai namanya kak. ubahKeArrayObjek(items); terima kasih February 6, 2023 at 10:54 PM #192101 AldyParticipant var items = [ [“Asus”, “laptop”, 7500000], [“Dell”, “laptop”, 7000000], [“Corsair”, “ram”, 1250000], ] function changearrayobject(array2d){ var result = []; var tempObj = {}; for(var i = 0; i < array2d.length; i++){ tempObj.name = array2d[i] [0]; tempObj.type = array2d[i] [1]; tempObj.price = array2d[i] [2]; result.push(tempObj); tempObj = {}; } return result; } changearrayobject(items); tolong ini kenapa gak running ya? April 28, 2023 at 11:20 AM #194865 Coach VincentModerator Harus menggunakan console.log nya kak Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Login with your Social ID Log In