DEV Community

Cover image for JS objects' example (coffee intensity)
Designer Anna
Designer Anna

Posted on • Originally published at twitter.com

1

JS objects' example (coffee intensity)

function intensity(a){
return a+"%";}
//JS objects
var coffee = {
intensity1:intensity(55),
intensity2:intensity(75),
intensity3:intensity(90)

};

document.write="Coffee is "+coffee.intensity1+" strong"
document.write="Coffee is "+coffee.intensity2+" strong"
document.write="Coffee is "+coffee.intensity3+" strong"

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay