Shorthand Syntax for Object Property Value in ES6 Last Updated : 20 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Objects in JavaScript are the most important data-type and forms the building blocks for modern JavaScript. These objects are quite different from JavaScript primitive data-types (Number, String, Boolean, null, undefined, and symbol) in the sense that while these primitive data-types all store a single value each (depending on their types). The shorthand syntax for object property value is very popular and widely used nowadays. The code looks cleaner and easy to read. The shorthand property makes the code size smaller and simpler. Example: This example displaying the details of object using shorthand Syntax for object property value in ES6. javascript // Object property shorthand const name = 'Raj' const age = 20 const location = 'India' // User with ES6 shorthand // property const user = { name, age, location } console.log(user) Output: Example: This example displaying the details of the object without using shorthand Syntax for object property value. javascript // Object property shorthand const name = 'Raj' const age = 20 const location = 'India' // User without ES6 // shorthand property const user = { name: name, age: age, location: location } console.log(user) Output: Comment More infoAdvertise with us Next Article Shorthand Syntax for Object Property Value in ES6 G gouravhammad Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Misc ES6 Similar Reads How to add a property to a JavaScript object using a variable as the name? In JavaScript, you can dynamically add a property to an object using a variable as the name. This allows you to create flexible and dynamic objects based on runtime values, enhancing code reusability and adaptability. There are several methods that can be used to add a property to a JavaScript objec 2 min read How to Fix "Invalid Shorthand Property Initializer" in JavaScript? JavaScript is a powerful and flexible programming language but even seasoned developers can run into the errors. One such error is the "Invalid Shorthand Property Initializer." This error occurs when using the object literal shorthand incorrectly. This typically happens when try to the use a shortha 3 min read How to throw an error when using a property of an object ? In this article, we will try to understand how we may throw an error when using a property of an object with the help of certain theoretical explanations as well as coding examples in JavaScript. Let us first have a look over the below section which shows the syntax for creating an object having cer 4 min read How to Get an Object Value By Key in TypeScript In TypeScript, we can get an object value by key by accessing the specific properties within the objects of the dynamic type. This can be done using Dot Notation, Bracket Notation, and Optional Chaining. In this article, we will explore all these approaches along with their implementation in terms o 5 min read How to Get all Property Values of a JavaScript Object without knowing the Keys? To get all property values from a JavaScript object without knowing the keys involves accessing the object's properties and extracting their values.Below are the approaches to get all property values of a JavaScript Object:Table of ContentUsing Object.values() MethodUsing Object.keys() methodApproac 2 min read Like