Data Analytics
30.9K subscribers
567 photos
22 videos
48 files
393 links
Dive into the world of Data Analytics – uncover insights, explore trends, and master data-driven decision making.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
# 📚 JavaScript Tutorial - Part 1/10: The Complete Beginner's Guide
#JavaScript #WebDev #Programming #BeginnerFriendly

Welcome to Part 1 of our comprehensive 10-part JavaScript series! This tutorial is designed for absolute beginners with detailed explanations and practical examples.

---

## 🔹 What is JavaScript?
JavaScript is a high-level, interpreted programming language that:
- Runs in web browsers (client-side)
- Can also run on servers (Node.js)
- Adds interactivity to websites
- Works with HTML/CSS to create dynamic web pages

Key Features:
✔️ Event-driven programming
✔️ Supports object-oriented and functional styles
✔️ Dynamically typed
✔️ Asynchronous operations (callbacks, promises)

---

## 🔹 JavaScript vs Other Languages
| Feature | JavaScript | Python | Java |
|---------------|---------------|---------------|---------------|
| Typing | Dynamic | Dynamic | Static |
| Execution | Interpreted | Interpreted | Compiled |
| Platform | Browser/Server| Multi-purpose | JVM |
| Paradigms | Multi-paradigm| Multi-paradigm| OOP |

---

## 🔹 How JavaScript Runs?
1. Browser loads HTML/CSS
2. JavaScript engine (V8, SpiderMonkey) executes JS code
3. Can manipulate DOM (Document Object Model)
4. Handles user interactions

HTML → Browser → JavaScript Engine → Execution


---

## 🔹 Setting Up JavaScript
### 1. In HTML File (Most Common)
<script>
// Your JavaScript code here
alert("Hello World!");
</script>

<!-- OR External File -->
<script src="script.js"></script>


### 2. Browser Console
- Press F12 → Console tab
- Type JS commands directly

### 3. Node.js (Server-Side)
node filename.js


---

## 🔹 Your First JavaScript Program
// Single line comment
/* Multi-line
comment */

// Print to console
console.log("Hello World!");

// Alert popup
alert("Welcome to JavaScript!");

// HTML output
document.write("<h1>Hello from JS!</h1>");


---

## 🔹 Variables & Data Types
JavaScript has 3 ways to declare variables:

### 1. Variable Declaration
let age = 25;        // Mutable (block-scoped)
const PI = 3.14; // Immutable
var name = "Ali"; // Old way (function-scoped)


### 2. Data Types
| Type | Example | Description |
|-------------|--------------------------|--------------------------|
| Number | 42, 3.14 | All numbers |
| String | "Hello", 'World' | Text data |
| Boolean | true, false | Logical values |
| Object | {name: "Ali", age: 25} | Key-value pairs |
| Array | [1, 2, 3] | Ordered lists |
| Null | null | Intentional empty value |
| Undefined | undefined | Uninitialized variable |

### 3. Type Checking
typeof "Hello";    // "string"
typeof 42; // "number"
typeof true; // "boolean"
typeof {}; // "object"


---

## 🔹 Operators
### 1. Arithmetic
let x = 10, y = 3;
console.log(x + y); // 13
console.log(x - y); // 7
console.log(x * y); // 30
console.log(x / y); // 3.333...
console.log(x % y); // 1 (modulus)


### 2. Comparison
console.log(5 == "5");   // true (loose equality)
console.log(5 === "5"); // false (strict equality)
console.log(5 != "5"); // false
console.log(5 !== "5"); // true


### 3. Logical
true && false;    // AND → false
true || false; // OR → true
!true; // NOT → false


---

## 🔹 Type Conversion
### 1. Explicit Conversion
String(123);        // "123"
Number("3.14"); // 3.14
Boolean(1); // true


### 2. Implicit Conversion
"5" + 2;      // "52" (string concatenation)
"5" - 2; // 3 (numeric operation)


---

## 🔹 Practical Example: Simple Calculator
<script>
let num1 = parseFloat(prompt("Enter first number:"));
let num2 = parseFloat(prompt("Enter second number:"));

console.log(`Addition: ${num1 + num2}`);
console.log(`Subtraction: ${num1 - num2}`);
console.log(`Multiplication: ${num1 * num2}`);
console.log(`Division: ${num1 / num2}`);
</script>


---
# 📚 JavaScript Tutorial - Part 2/10: Control Flow & Functions
#JavaScript #WebDev #Programming #Beginners

Welcome to Part 2 of our JavaScript series! Today we'll master decision-making and functions - the building blocks of programming logic.

---

## 🔹 Conditional Statements
Control program flow based on conditions.

### 1. if-else Statement
let age = 18;

if (age >= 18) {
console.log("You're an adult");
} else {
console.log("You're a minor");
}


### 2. Ternary Operator (Shorthand if-else)
let message = (age >= 18) ? "Adult" : "Minor";
console.log(message);


### 3. switch-case Statement
let day = 3;
let dayName;

switch(day) {
case 1: dayName = "Monday"; break;
case 2: dayName = "Tuesday"; break;
case 3: dayName = "Wednesday"; break;
default: dayName = "Unknown";
}

console.log(dayName); // "Wednesday"


---

## 🔹 Loops
Execute code repeatedly.

### 1. for Loop
for (let i = 1; i <= 5; i++) {
console.log(`Count: ${i}`);
}
// Output: 1, 2, 3, 4, 5


### 2. while Loop
let count = 1;
while (count <= 5) {
console.log(count);
count++;
}


### 3. do-while Loop
let x = 1;
do {
console.log(x);
x++;
} while (x <= 5);


### 4. for...of Loop (Arrays)
const colors = ["red", "green", "blue"];
for (const color of colors) {
console.log(color);
}


### 5. for...in Loop (Objects)
const person = {name: "Ali", age: 25};
for (const key in person) {
console.log(`${key}: ${person[key]}`);
}


---

## 🔹 Functions
Reusable blocks of code.

### 1. Function Declaration
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet("Ali")); // "Hello, Ali!"


### 2. Function Expression
const square = function(x) {
return x * x;
};
console.log(square(5)); // 25


### 3. Arrow Functions (ES6+)
const add = (a, b) => a + b;
console.log(add(2, 3)); // 5


### 4. Default Parameters
function createUser(name, role = "user") {
console.log(`${name} is a ${role}`);
}
createUser("Ali"); // "Ali is a user"


### 5. Rest Parameters
function sum(...numbers) {
return numbers.reduce((total, num) => total + num, 0);
}
console.log(sum(1, 2, 3)); // 6


---

## 🔹 Practical Example: Grade Calculator
function calculateGrade(score) {
if (score >= 90) return "A";
else if (score >= 80) return "B";
else if (score >= 70) return "C";
else return "F";
}

const studentScore = 85;
console.log(`Grade: ${calculateGrade(studentScore)}`); // "Grade: B"


---

## 🔹 Scope in JavaScript
### 1. Global Scope
const globalVar = "I'm global";

function test() {
console.log(globalVar); // Accessible
}


### 2. Function Scope (var)
function test() {
var functionVar = "I'm function-scoped";
}
console.log(functionVar); // Error: Not accessible


### 3. Block Scope (let/const)
if (true) {
let blockVar = "I'm block-scoped";
}
console.log(blockVar); // Error: Not accessible


---

## 🔹 Error Handling
### 1. try-catch-finally
try {
// Risky code
nonExistentFunction();
} catch (error) {
console.log("Error occurred:", error.message);
} finally {
console.log("This always executes");
}


### 2. Throwing Custom Errors
function divide(a, b) {
if (b === 0) throw new Error("Cannot divide by zero!");
return a / b;
}


---

## 🔹 Best Practices
1. Use strict equality (===) over ==
2. Prefer const/let over var
3. Keep functions small/single-purpose
4. Always handle errors
5. Use descriptive names for functions/variables

---

### 📌 What's Next?
In Part 3, we'll cover:
➡️ Arrays & Array Methods
➡️ Objects & JSON
➡️ Destructuring

#LearnJavaScript #CodingBasics #WebDevelopment 🚀

Practice Exercise:
1. Create a function to check if a number is even/odd
2. Write a loop that prints prime numbers up to 20
3. Make a temperature converter function (Celsius ↔️ Fahrenheit)
❤5
# 📚 JavaScript Tutorial - Part 3/10: Arrays, Objects & JSON
#JavaScript #WebDev #Programming #DataStructures

Welcome to Part 3 of our JavaScript series! Today we'll master arrays, objects, and JSON - essential for handling complex data.

---

## 🔹 Arrays in JavaScript
Ordered collections that can hold multiple values.

### 1. Creating Arrays
// Array literal (recommended)
const fruits = ['Apple', 'Banana', 'Orange'];

// Array constructor
const numbers = new Array(1, 2, 3);

// Mixed data types
const mixed = [1, 'Hello', true, {name: 'Ali'}];


### 2. Accessing Elements
console.log(fruits[0]);  // "Apple" (0-based index)
console.log(fruits.length); // 3


### 3. Common Array Methods
| Method | Description | Example |
|--------|-------------|---------|
| push() | Add to end | fruits.push('Mango') |
| pop() | Remove from end | fruits.pop() |
| shift() | Remove from start | fruits.shift() |
| unshift() | Add to start | fruits.unshift('Kiwi') |
| slice() | Get sub-array | fruits.slice(1, 3) |
| splice() | Add/remove items | fruits.splice(1, 0, 'Berry') |

---

## 🔹 Modern Array Methods (ES6+)
Powerful functional programming tools.

### 1. forEach()
fruits.forEach(fruit => console.log(fruit));


### 2. map()
const upperFruits = fruits.map(fruit => fruit.toUpperCase());


### 3. filter()
const longFruits = fruits.filter(fruit => fruit.length > 5);


### 4. reduce()
const sum = [1, 2, 3].reduce((total, num) => total + num, 0);


### 5. find() & findIndex()
const banana = fruits.find(fruit => fruit === 'Banana');
const bananaIndex = fruits.findIndex(fruit => fruit === 'Banana');


### 6. some() & every()
const hasApple = fruits.some(fruit => fruit === 'Apple');
const allLong = fruits.every(fruit => fruit.length > 3);


---

## 🔹 Objects in JavaScript
Collections of key-value pairs (properties).

### 1. Creating Objects
// Object literal (recommended)
const person = {
name: 'Ali',
age: 25,
hobbies: ['reading', 'coding'],
address: {
city: 'Dubai',
country: 'UAE'
}
};


### 2. Accessing Properties
// Dot notation
console.log(person.name); // "Ali"

// Bracket notation (useful for dynamic keys)
const key = 'age';
console.log(person[key]); // 25


### 3. Modifying Objects
// Add property
person.job = 'Developer';

// Delete property
delete person.age;

// Check property existence
'name' in person; // true


---

## 🔹 Object Methods
### 1. Object.keys()
const keys = Object.keys(person);  // ["name", "age", ...]


### 2. Object.values()
const values = Object.values(person);


### 3. Object.entries()
for (const [key, value] of Object.entries(person)) {
console.log(`${key}: ${value}`);
}


### 4. Object Spread (ES9+)
const newPerson = {...person, age: 26};


---

## 🔹 JSON (JavaScript Object Notation)
Universal data format for APIs.

### 1. JSON ↔️ JavaScript
// Object to JSON string
const jsonStr = JSON.stringify(person);

// JSON string to object
const parsedObj = JSON.parse(jsonStr);


### 2. JSON Structure
{
"name": "Ali",
"age": 25,
"isStudent": false,
"courses": ["Math", "CS"]
}


---

## 🔹 Destructuring Assignment
Unpack values from arrays/objects.

### 1. Array Destructuring
const [first, second] = fruits;
console.log(first); // "Apple"


### 2. Object Destructuring
const {name, age} = person;
console.log(name); // "Ali"

// With renaming
const {name: personName} = person;


### 3. Function Parameter Destructuring
function printUser({name, age}) {
console.log(`${name} is ${age} years old`);
}


---
## 🔹 Practical Example: Todo List Manager
const todoList = [
{id: 1, task: 'Buy groceries', completed: false},
{id: 2, task: 'Do laundry', completed: true}
];

// Add new task
function addTask(task) {
const newTask = {
id: todoList.length + 1,
task,
completed: false
};
todoList.push(newTask);
}

// Mark task as complete
function completeTask(id) {
const task = todoList.find(item => item.id === id);
if (task) task.completed = true;
}

// Get pending tasks
function getPendingTasks() {
return todoList.filter(task => !task.completed);
}


---

## 🔹 Best Practices
1. Use `const` for arrays/objects (the reference is constant)
2. Prefer functional methods (map, filter) over loops
3. Validate JSON before parsing
4. Use descriptive property names
5. Destructure deeply nested objects carefully

---

### 📌 What's Next?
In Part 4, we'll cover:
➡️ DOM Manipulation
➡️ Event Handling
➡️ Form Validation

#JavaScript #WebDevelopment #Programming 🚀

Practice Exercise:
1. Create an array of products (name, price, inStock)
2. Write functions to:
- Filter out-of-stock products
- Calculate total inventory value
- Sort by price (high-to-low)
3. Convert your array to JSON and back
Forwarded from Github Top Repositories
🔥 Trending Repository: LearnRust

📝 Description: Rust Learning Resources

🔗 Repository URL: https://github.com/ImplFerris/LearnRust

🌐 Website: https://implrust.com

📖 Readme: https://github.com/ImplFerris/LearnRust#readme

📊 Statistics:
🌟 Stars: 1.8K stars
👀 Watchers: 32
🍴 Forks: 188 forks

💻 Programming Languages: Not available

🏷️ Related Topics:
#rust #learning #programming #rust_lang #rust_tutorial #learn_rust #rust_programming


==================================
🧠 By: https://t.iss.one/DataScienceN
❤1
Cheat sheet for working with data in Python (Data Science) 🐍📊

🔹 importing NumPy and pandas libraries — basic tools for data processing 🛠️

🔹 text files — reading/writing plain text and working via context manager 📄

🔹 tabular CSV/flat files — loading and processing structured data into DataFrame 📊

🔹 Excel files — working with sheets and tables 📑

🔹 SAS/Stata files — importing statistical formats 📉

🔹 HDF5 and Pickle — saving and loading complex data structures 💾

🔹 MATLAB files — reading .mat via SciPy 🧮

🔹 relational databases (SQL) — connecting, querying, and converting results into DataFrame 🗄️

🔹 Python dictionaries — accessing keys, values, and nested structures 🔑

🔹 data exploration (NumPy arrays and pandas DataFrames) — viewing types, sizes, and basic statistics 🔍

🔹 file system navigation — magic commands and os module for working with files and directories 📂

#Python #DataScience #Coding #Programming #Tech #Learning

https://t.iss.one/DataAnalyticsX ✅
Please open Telegram to view this post
VIEW IN TELEGRAM
❤3
🔖 Instructions for AI Agents

Please refer to AGENTS.md – a guide dedicated to the file of the same name, which contains instructions for AI agents. 🤖

The website explains what should be included in AGENTS.md, how to format it correctly, and provides examples from over 60,000 projects. 📚

http://AGENTS.md/

✨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
#AI #Agents #AGENTSmd #Tech #Development #Programming
❤3
Forwarded from Machine Learning
Media is too big
VIEW IN TELEGRAM
A Collection of Machine Learning Libraries for Python 🤖

A large repository containing over 900 libraries and frameworks for machine learning. 📚

All projects are sorted by quality and popularity, which helps you quickly find the best tools for working with AI and ML. ⚙️

Repo: https://github.com/ml-tooling/best-of-ml-python?tab=readme-ov-file#vector-similarity-search-ann

#MachineLearning #Python #AI #DataScience #MLTools #Programming

✨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤5
Forwarded from Udemy Free
Hands On Python Data Science - Data Science Bootcamp

Master Python for Data Science with Real-World Applications: Dive Deep into Data Analysis, Machine Learning

🏷 Category: Development
🌍 Language: English
👥 Students: 31,524 students
⭐️ Rating: 4.3/5.0
💰 Price: $14.99 ⟹ FREE
🆔 Coupon: •••••••••• (tap below to reveal)

🔓 Tap "Get Coupon" below — the code unlocks inside the app after a short rewarded ad.

💎 By: https://t.iss.one/Udemy26
#Programming #Coding #Development #Tech #Python #DataScience
❤3
A distinctive bot for subscribing to courses on the most popular educational platforms across multiple fields, most notably programming, artificial intelligence, mechanics, medicine, and other sciences. 🎓🤖

This bot provides a free subscription to any course available within the bot. 🆓

https://t.iss.one/UdemySybot?start=ref_418788114

#FreeCourses #Programming #AI #Education #Udemy #TelegramBots