What is an example of an object literal?

JavaScript: What is an example of an object literal?

An object literal is something like this, in JS:

  1. var objectLiteral = { something: true, somethingElse: "webdevetc" }

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about What is an example of an object literal?

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the JavaScript language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

What does PEAR stand for?

What is snake case?

How to find out which php.ini file PHP is using?

How to round a number in JS?

How to provide a default model object for relationships?

How to view all installed PHP modules?

How do Invokable Controllers work in Laravel?

How to hide certain file types from directory listings

How to replace values in a string, in JS

How to generate an array for a dropdown (with ['key' => 'value']) suitable for a dropdown, from a Laravel collection of Eloquent objects?