---
title: "how to create object and assign the value in object?"  
description: "how to create object and assign the value in object?"  
author: "Amit Singh"  
published: 2011-03-18  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/525/how-to-create-object-and-assign-the-value-in-object  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# how to create object and assign the value in object?

Create new object\
var obj =new Object();\
or\
obj={};\
\
Assign the value in object\
obj["name"]="amit";\
or\
obj.name="amit";

## Answers

### Answer by Amit Singh

Create new object\
var obj =new Object();\
or\
obj={};\
\
Assign the value in object\
obj["name"]="amit";\
or\
obj.name="amit";


---

Original Source: https://www.mindstick.com/interview/525/how-to-create-object-and-assign-the-value-in-object

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
