let prom = "globalna promenljiva";
let obj = {
x: 34,
y: 22,
f: function() {
console.log(prom);
},
obj2 = {
x2: 23,
y2: 87,
f2: function() {
console.log(prom);
}
}
}
obj.obj2.f2();
To embed this project on your website, copy the following code and paste it into your website's HTML: