Javascript Programming Basics
Javascript Programming Basics
and interactive content on web pages. JavaScript is one of the core technologies of the World Wide
1. Setting Up JavaScript
To start coding in JavaScript, you only need a web browser and a text editor.
```html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
```
```javascript
alert("Hello, World!");
```
To run:
- String: "Hello"
- Boolean: true/false
- Array: [1, 2, 3]
Example:
```javascript
```
4. Control Flow
JavaScript supports if-else, switch, for, while, and do-while loops.
Example (if-else):
```javascript
if(number > 0) {
console.log("Positive number");
} else {
console.log("Negative number");
```