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

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.


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 'final class' and 'final function' (final method) mean in PHP?

What is the difference between integration and unit tests?

How to remove .php from the end of URLs with .htaccess

What is Bubble sort, and how to write an implementation of it in PHP

How to have a whitelist of IP addresses that can access files in .htaccess

How to set up an alias to map one directory to another destination

How to add the default charset to UTF-8 in .htaccess

What kind of database field type should you (normally) use for foreign keys?

Set PHP config Variables (like ini_set) with .htaccess

How to group a SQL statement in brackets/parenthesis