- Create an HTML file
Create a new file with a .html
extension. For example, index.html
.
- Include JavaScript in the HTML file
- method 1 : using script tag
- method 2 : direct Html injection
- Variables and Data Types
JavaScript has different data types like string
, number
, boolean
, null
, undefined
, and object
.
- Arrays
An array is a special variable, which can hold more than one value at a time.
- Functions
Functions are blocks of code designed to perform a particular task.
- Control Structures
Control structures like if
, else
, for
, while
, etc. are used to control the flow of execution.
- Objects
Objects are collections of key-value pairs.