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 is the difference between ( for ... in ) and ( for ... of ) in javascript?

How to Enable Directory Listings in Apache with .htaccess

How to eager load multiple levels of relationships in Eloquent?

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

What does PEAR stand for?

What are generators in PHP, and how do they compare to arrays?

How to select what columns to return when calling ::all()

What is camel case?

How to add the CSRF (Cross-site request forgery) token in Laravel?

How do Invokable Controllers work in Laravel?