Monday, November 8, 2021
The most common ways you see how objects are created in JavaScript is the object literal syntax. The object literal syntax is the open { } with comma separated name: pair value lists. The name: part is the name of the property. The part after : is the property value which can hold a primitive value or another object. It could even be a function.
Here is an example of an object literal:
var product = {
name: "Chai",
Category: "Tea",
Country: "India",
supplier: {
name: "ACME Tea Of India",
location : "New Delhi"
},
related: ["Earl Grey", "Green Tea", "Dark Tea", "White Tea"],
display: function () {
console.log(this);
}
};
If you open this in the browser you will see that product object is made up of properties, another object called supplier, an array related, and a function called display()
Here is an example of an object literal:
var product = {
name: "Chai",
Category: "Tea",
Country: "India",
supplier: {
name: "ACME Tea Of India",
location : "New Delhi"
},
related: ["Earl Grey", "Green Tea", "Dark Tea", "White Tea"],
display: function () {
console.log(this);
}
};
If you open this in the browser you will see that product object is made up of properties, another object called supplier, an array related, and a function called display()
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Thanks for your post. I’ve been thinking about writing a very comparable post over the last couple of weeks, I’ll probably keep it short and sweet and link to this instead if thats cool. Thanks. https://www.whocall.biz
ReplyDeleteDefine an object using { } brackets and key:values and their correlates differ by a comma. Depending upon the specific circumstances, it would either be a bare word which would be the name of the property or a literal or a function. I am also confuse in javascript program But recently I buy dissertation service in program which is very nice if you are stuck.
ReplyDelete