 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to recognize when to use : or = in JavaScript?
The colon (:) can be used when you want to define the property to an object while equal (=) can be used when you want to assign a value to a variable.
Example
Following is the code −
var studentDetails = {    "studentId": 101,    "studentName": "John",    "studentSubjectName": "Javascript",    "studentCountryName": "US" } console.log(studentDetails); var firstName = "David"; console.log(firstName); To run the above program, you need to use the below command −
node fileName.js.
Here, my file name is demo325.js.
Output
This will produce the following output −
PS C:\Users\Amit\javascript-code> node demo325.js {    studentId: 101,    studentName: 'John',    studentSubjectName: 'Javascript',    studentCountryName: 'US' } DavidAdvertisements
 