- JavaScript Introduction
- JavaScript Where To
- JavaScript Output
- JavaScript Statements
- JavaScript Syntax
- JavaScript Comments
- JavaScript Variables
- JavaScript Let
- JavaScript Const
- JavaScript Operators
- JavaScript Arithmetic
- JavaScript Assignment
- JavaScript Data Types
- JavaScript Functions
- JavaScript Objects
- JavaScript Events
- JavaScript Strings
- JavaScript String Methods
- JavaScript Numbers
- JavaScript Number Methods
- JavaScript Arrays
- JavaScript Array Const
- JavaScript Array Methods
- JavaScript Sorting Arrays
- JavaScript Array Iteration
- JavaScript Date Objects
- JavaScript Date Formats
- JavaScript Get Date Methods
- JavaScript Set Date Methods
- JavaScript Math Object
- JavaScript Random
- JavaScript Booleans
- JavaScript Comparison And Logical Operators
- JavaScript If Else And Else If
- JavaScript Switch Statement
- JavaScript For Loop
- JavaScript Break And Continue
- JavaScript Type Conversion
- JavaScript Bitwise Operations
- JavaScript Regular Expressions
- JavaScript Errors
- JavaScript Scope
- JavaScript Hoisting
- JavaScript Use Strict
- The JavaScript This Keyword
- JavaScript Arrow Function
- JavaScript Classes
- JavaScript JSON
- JavaScript Debugging
- JavaScript Style Guide
- JavaScript Best Practices
- JavaScript Common Mistakes
- JavaScript Performance
- JavaScript Reserved Words
- JavaScript Versions
- JavaScript History
- JavaScript Forms
- JavaScript Validation API
- JavaScript Objects
- JavaScript Object Properties
- JavaScript Function Definitions
- JavaScript Function Parameters
- JavaScript Function Invocation
- JavaScript Closures
- JavaScript Classes
- Java Script Async
- JavaScript HTML DOM
- The Browser Object Model
- JS Ajax
- JavaScript JSON
- JavaScript Web APIs
- JS Vs JQuery
JavaScript Syntax
JavaScript Syntax
The collection of guidelines that make up the syntax for JavaScript programmes are as follows:
???????
x = 5; y = 6; // Assign Values
z = x + y; // Compute Values
JavaScript Values
The JavaScript syntax defines two types of values:
- Fixed values
- Variable values
Fixed values are called Literals.
Variable values are called Variables.
JavaScript Literals
The following are the top two syntax guidelines for fixed values:
1. Decimals are used or not used when writing numbers:
1001
???????
'John Doe'
JavaScript Variables
In a programming language, variables are used to store data values.
JavaScript uses the var
keyword to declare variables.
An equal sign is used to assign values to variables.
In this example, x is defined as a variable. Then, x is assigned (given) the value 6:
x = 6;
JavaScript Operators
JavaScript calculates values using the arithmetic operators (+ - * /)
??????????????
x = 5;
y = 6;
JavaScript Expressions
A set of values, variables, and operators combined to produce a value is called an expression.
An assessment is the name of the calculation.
For instance, 5 * 10 equals 50:
Values of several sorts, including strings and numbers, are possible.
As an illustration, "John" + " " + "Doe" equals "John Doe":
JavaScript Keywords
Actions to be taken are identified using JavaScript keywords.
The browser is instructed to create variables with the var keyword:
x = 5 + 6;
y = x * 10;
JavaScript Comments
Not every JavaScript command is "executed."
Code that follows a double slash (//) or that is between a /* and */ is regarded as a comment.
Comments are disregarded and won't be carried out:
// var x = 6; I will NOT be executed
JavaScript Identifiers
Names are identifiers.
Identifiers are used to name variables in JavaScript (and keywords, and functions, and labels).
In most computer languages, the guidelines for legal names are largely the same.
The initial character in JavaScript must be a letter, underscore (_), or dollar sign ($).
Characters beyond that could be letters, numbers, underscores, or dollar signs.
There can be no numbers in the first character.
In this manner, identifiers and integers can be easily distinguished by JavaScript.
JavaScript Is Case Sensitive
Case affects every identifier in JavaScript.
There are two separate variables for lastName and lastname:
lastName = "Doe";
lastname = "Peterson";
JavaScript And Camel Case
Programmers have historically combined several words into a single variable name in a variety of ways:
Hyphens:
Mastercard, inter-city, first and last names
In JavaScript, hyphens are not allowed. They are only used in subtraction.
Underscore:
first_name, last_name, master_card, inter_city.
Upper Camel Case (Pascal Case):
FirstName, LastName, MasterCard, InterCity.
Lower Camel Case:
JavaScript programmers tend to use camel case that starts with a lowercase letter:
firstName, lastName, masterCard, interCity.
JavaScript Character Set
JavaScript uses Unicode as its character set.
Unicode encompasses (almost) every character, punctuation mark, and symbol in the world.
COMPANY
Products
Partner
Copyright © RVR Innovations LLP 2024 | All rights reserved - Mytat.co is the venture of RVR Innovations LLP