Buat objek JSON di JavaScript
var employee = {
"firstName": firstName,
"lastName": lastName
}
Precious Panther
var employee = {
"firstName": firstName,
"lastName": lastName
}
var msg = {};
var str ='{';
for(let x=0;x<2;x++){
str+= '"value'+x+'":'+ x +','
}
str=str.substring(0,str.length-1);
str+='}';
var js = JSON.parse(str);
console.log(js)
const student = {
name: "bob",
age: 7,
grade: 6
}