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

How to show (or log) all SQL queries executed by Laravel

How to show a specific view file for certain error codes?

How to install and use jpegoptim on Linux CentOS

How to find the 2nd most common item in an array?

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

How to make multiple routes share the same URL structure or URL parameters

How to Force www or non-www in htaccess

What is the max size, by default, of GET variables?

How to create random numbers in JS?

How to block an IP range based on CIDR in Apache with .htaccess