https://github.com/hakeemsalman/javascript-basics
Fundamentals of Javascripts
https://github.com/hakeemsalman/javascript-basics
Last synced: about 2 months ago
JSON representation
Fundamentals of Javascripts
- Host: GitHub
- URL: https://github.com/hakeemsalman/javascript-basics
- Owner: hakeemsalman
- License: mit
- Created: 2025-04-04T10:37:14.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-04T10:37:40.000Z (2 months ago)
- Last Synced: 2025-04-15T14:59:52.917Z (about 2 months ago)
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Javascript Fundamentals
### Keypoints:
1. _JavaScript_ was initially created to “make web pages alive”.
2. The programs in this language are called scripts. They can be written right in a web page’s HTML and run automatically as the page loads.
3. Scripts are provided and executed as plain text. They don’t need special preparation or compilation to run.#### Fundamentals
- [Javascript Fundamentals](#javascript-fundamentals)
- [Keypoints:](#keypoints)
- [Fundamentals](#fundamentals)
- [1 Hello World](#1-hello-world)
- [2 Code statements, semicolon, comments](#2-code-statements-semicolon-comments)
- [Statements](#statements)
- [**Semicolon**](#semicolon)
- [**Comments**](#comments)
- [3 Modern Mode](#3-modern-mode)
- [4 Variables](#4-variables)
- [**Variable Naming**](#variable-naming)
- [Keypoints:](#keypoints-1)
- [Reserved words](#reserved-words)
- [**Constants**](#constants)
- [5 Data types](#5-data-types)
- [1 Number](#1-number)
- [2 BigInt](#2-bigint)
- [3 String](#3-string)
- [4 Boolean](#4-boolean)
- [5 Null](#5-null)
- [6 Undefined](#6-undefined)
- [7 Objects](#7-objects)
- [8 Symbols](#8-symbols)
- [typeof Operator](#typeof-operator)
- [6 Interaction](#6-interaction)
- [1 Alert](#1-alert)
- [2 Prompt](#2-prompt)
- [3 Confirm](#3-confirm)
- [7 Type Conversions](#7-type-conversions)
- [1 String](#1-string)
- [2 Number](#2-number)
- [3 Boolean](#3-boolean)
- [8 Basic operators, maths](#8-basic-operators-maths)
- [1 String concatenation](#1-string-concatenation)
- [2 Operator precedence](#2-operator-precedence)
- [3 Modify-in-place](#3-modify-in-place)
- [4 Increment \& decrement](#4-increment--decrement)
- [5 Bitwise operators](#5-bitwise-operators)
- [6 Comma](#6-comma)
- [9 Comparisions](#9-comparisions)
- [1 String comparisions](#1-string-comparisions)
- [2 Strict equality](#2-strict-equality)
- [10 Conditions](#10-conditions)
- [11 Logical operators](#11-logical-operators)
- [12 Nullish coalescing operator '??'](#12-nullish-coalescing-operator-)
- [13 Loops: while \& for](#13-loops-while--for)
- [1 While Loop](#1-while-loop)
- [2 do...while loop](#2-dowhile-loop)
- [3 for loop](#3-for-loop)
- [4 Break and Continue](#4-break-and-continue)
- [5 Continue](#5-continue)
- [6 Label](#6-label)
- [14 Switch statements](#14-switch-statements)
- [15 Functions](#15-functions)
- [1 Local variables](#1-local-variables)
- [2 Outer variables](#2-outer-variables)
- [3 Parameters](#3-parameters)
- [4 Default values](#4-default-values)
- [5 Returning a value](#5-returning-a-value)
- [6 Naming a function](#6-naming-a-function)
- [16 Function expressions](#16-function-expressions)
- [1 Function is a value](#1-function-is-a-value)
- [2 Callback functions](#2-callback-functions)
- [3 Function Expression vs Function Declaration](#3-function-expression-vs-function-declaration)
- [17 Arrow functions, the basics](#17-arrow-functions-the-basics)
- [Resources](#resources)## 1 Hello World
1. To run script in browser, add `script` tag in html file. You can place tag almost anywhere in HTML document.
2. The `` tag contains JavaScript code which is automatically executed when the browser processes the tag.
3. Script files are attached to HTML with the `src` attribute.<table>
<tr><td>Code</td> <td>Output</td> </tr>
<tr>
<td>```html
<html>
<body>
<p>Before the script...</p>
<script>
alert("Hello, world!");
...After the script.