[javascript]
var object =
{
a:10;
b:20;
s:’hello’
};
$.each(object, function(name, value)
{
console.log(name+’:’+value);
});
[/javascript]
[javascript]
var object =
{
a:10;
b:20;
s:’hello’
};
$.each(object, function(name, value)
{
console.log(name+’:’+value);
});
[/javascript]
© 2023 Best jQuery.
there is a spelling mistake.
js object literals cannot have the “;” sign. It must be “,”
So it is:
{
a:10,
b:20,
s:’hello’
}