Welcome to the Zero to Hero project repository! This code showcases the essentials of JavaScript variable declaration, initialization, and output using console.log(). Aimed at beginners and enthusiasts alike, this example embodies simplicity and elegance.
- Variable Types:
- Undefined: Declared but not assigned (
let variable). - String: Initialized with
"HuXn WebDev"and"WebDev Academy".
- Undefined: Declared but not assigned (
- Output: Utilizing
console.log()to display the values.
// ๐ Reserved Keyword: Variable Declaration
let variable; // undefined
let name = "HuXn WebDev"; // Example string initialization
console.log(name); // Logs: HuXn WebDev
const channelName = "WebDev Academy"; // Constant string initialization
console.log(channelName); // Logs: WebDev Academy
# ๐ Math Operations with JavaScript Numbers ๐
## โจ Overview
This project explores the fundamental numerical operations in JavaScript, showcasing both **whole numbers** and **basic arithmetic functions**. Dive into the elegant world of code as we play with numbers and operators!
---
## ๐ Code Highlights
### ๐งฎ Numbers Used:
- **Whole Numbers:** `randomNumber = 10200`, `favNumber = 21`
- **Decimal Numbers:** Not explicitly included, but can be easily integrated.
- **Increment & Decrement:** Operations showcased with `num`.
### โ๏ธ Code Snippet:
```javascript
// ๐ข Whole Number (integers)
// ๐ Decimal Numbers
const randomNumber = 10200; // Example of a large integer
const favNumber = 21; // Example of a small integer
let num = 2; // Starting point for increment/decrement operations
// ๐ต Basic Math Operations
console.log(2 + 2); // โ Addition
console.log(2 - 2); // โ Subtraction
console.log(2 * 2); // โ Multiplication
console.log(2 / 2); // โ Division
console.log(2 % 2); // โฐ Modulus (remainder)
console.log(2 ** 2); // โจ Exponentiation
console.log(num++); // ๐บ Post-increment
console
# ๐ JavaScript Falsy Values and Number Operations ๐
## ๐ ๏ธ Overview
Dive into the fascinating world of **Falsy Values** in JavaScript and a demonstration of basic arithmetic. This repository highlights JavaScript's quirks and logical foundations when working with numbers and undefined values.
---
## ๐ Code Highlights
### ๐งฉ Key Features:
- **Falsy Values:** Explore JavaScript's "falsy" quirks including `false`, `null`, `undefined`, and more.
- **Basic Arithmetic:** Demonstrates addition involving `undefined`.
- **Variable Types:** Example of a variable holding `NaN` (Not-A-Number).
### ๐ Code Snippet:
```javascript
// ๐ข Reserved Keywords: Variable Declaration and Initialization
let isLoggedIn = NaN; // Assigning Not-A-Number to the variable
let numbers = 10; // A whole number example
console.log(numbers + undefined); // Outputs # ๐ JavaScript Falsy Values and Number Operations ๐
## ๐ ๏ธ Overview
Dive into the fascinating world of **Falsy Values** in JavaScript and a demonstration of basic arithmetic. This repository highlights JavaScript's quirks and logical foundations when working with numbers and undefined values.
---
## ๐ Code Highlights
### ๐งฉ Key Features:
- **Falsy Values:** Explore JavaScript's "falsy" quirks including `false`, `null`, `undefined`, and more.
- **Basic Arithmetic:** Demonstrates addition involving `undefined`.
- **Variable Types:** Example of a variable holding `NaN` (Not-A-Number).
### ๐ Code Snippet:
```javascript
// ๐ข Reserved Keywords: Variable Declaration and Initialization
let isLoggedIn = NaN; // Assigning Not-A-Number to the variable
let numbers = 10; // A whole number example
console.log(numbers + undefined); // Outputs NaN due to addition with undefined
// ๐ต Falsy Values in JavaScript:
false; // Boolean false
null; // Null value (absence of a value)
undefined; // Undefined value (no assignment)
0; // Zero
-0; // Negative zero
NaN; // Not-A-Number
''; "", ``; // Empty strings (single, double, or backticks)
NaN due to addition with undefined
// ๐ต Falsy Values in JavaScript:
false; // Boolean false
null; // Null value (absence of a value)
undefined; // Undefined value (no assignment)
0; // Zero
-0; // Negative zero
NaN; // Not-A-Number
''; "", ``; // Empty strings (single, double, or backticks)
# ๐ JavaScript Relational & Equality Operators ๐
## ๐ ๏ธ Overview
This repository delves into **Relational Operators** and **Equality Operators** in JavaScript. These foundational operators are essential for comparing values and writing conditional logic in your code.
---
## ๐ Code Highlights
### ๐งฉ Relational Operators:
Relational operators are used to compare two values, returning a boolean (`true` or `false`) based on the comparison.
| Operator | Description |
|----------|---------------------------------|
| `>` | Greater than |
| `<` | Less than |
| `>=` | Greater than or equal to |
| `<=` | Less than or equal to |
#### Code Example:
```javascript
console.log(10 > 10); // false
console.log(10 < 10); // false
console.log(10 >= 10); // true
console.log(10 <= 10); // true
# ๐ JavaScript String Manipulation Magic ๐
## ๐ ๏ธ Overview
Welcome to a captivating exploration of **string manipulation** in JavaScript. This repository demonstrates a variety of methods to play with and transform strings, showcasing the limitless possibilities of this powerful data type.
---
## ๐ Code Highlights
### ๐งฉ Features & Examples:
1. **Concatenation:**
- Combine strings using the `+` operator or `.concat()` method.
```javascript
let fullName = firstName + " " + lastName; // Adds a space between strings
let fullName = firstName.concat(lastName); // Direct concatenation
# ๐ธ JavaScript Conversion Methods: Numbers & Strings ๐ธ
## ๐ ๏ธ Overview
This project demonstrates various JavaScript methods for **type conversions**, including transforming numbers into strings, strings into numbers, and handling decimal values. Learn how to manipulate and convert data types with ease!
---
## ๐ Code Highlights
### ๐ Conversion Techniques:
1. **Convert String to Number:**
- Several methods are available to transform strings into numbers:
```javascript
amount = parseInt(amount); // Converts to an integer
amount = +amount; // Unary plus operator
amount = Number(amount); // Explicit conversion
```
2. **Convert Number to String:**
- Use the following methods to convert numbers into strings:
```javascript
money = money.toString(); // Converts using .toString()
money = String(money); // Explicit conversion
```
3. **Change String to Decimal:**
- Parse strings containing decimal values into numerical types:
```javascript
floatValue = parseFloat(floatValue); // Converts string "99.5" to decimal
console.log(floatValue); // Logs: 99.5
```
---
## ๐ How to Run
1. Copy the snippet into a JavaScript file or your browser's developer console.
2. Execute the code to see how conversions are handled and observe the outputs.
---
## ๐ Fun Facts
- **`parseInt()`** only parses whole numbers, while **`parseFloat()`** includes decimals.
- Using the **unary `+` operator** for conversion is a neat trick thatโs often overlooked!
- Conversions can help ensure proper data type handling during mathematical operations and comparisons.
---
## ๐จ Author
**HuXn WebDev**
Simplifying JavaScript intricacies for developers with precision and flair.
---
## ๐ License
This project is licensed under the **MIT License**, encouraging open collaboration and innovation.
---
Let me know if youโd like additional sections or even more flair added to this file! โจ๐