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 set infinite execution time in a PHP script

How to block IP addresses in Apache by using regular expressions (regex) in .htaccess

How to find out what version of Laravel you are using?

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

What does PEAR stand for?

How to prevent Eloquent from adding created_at or updated_at timestamps?

How to use Anonymous classes in PHP 7?

Point all requests to one PHP file

How to find an item by Primary Key in Eloquent, or throw a ModelNotFoundException exception if it isn't found?

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