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

How to select all rows for a certain month (or day, year or time), using Eloquent

What is the difference between ( for ... in ) and ( for ... of ) in javascript?

How do you run a PHP script from the command line?

What are the predefined variables in PHP?

What is the null coalescing operator in PHP7?

How to set custom HTTP headers in Apache (by editing .htaccess)

How to access the Laravel's route parameters outside of the controller?

How to block multiple IP addresses in .htaccess

How to check if a object has a static variable defined?

How to check if two strings are anagrams in PHP?