β
JavaScript Practice Questions β Part 2 π»π₯
π Q1. Swap two variables without a third variable.
β Answer:
π Q2. Find the largest number in an array.
β Answer:
π Q3. Check if a number is prime.
β Answer:
π Q4. Count vowels in a string.
β Answer:
π Q5. Convert first letter of each word to uppercase.
β Answer:
π¬ Tap β€οΈ for Part 3!
π Q1. Swap two variables without a third variable.
β Answer:
let a = 5, b = 10;
[a, b] = [b, a];
console.log(a, b); // Output: 10 5
π Q2. Find the largest number in an array.
β Answer:
let numbers = [3, 7, 2, 9, 5];
let max = Math.max(...numbers);
console.log(max); // Output: 9
π Q3. Check if a number is prime.
β Answer:
function isPrime(n) {
if (n <= 1) return false;
for (let i = 2; i <= Math.sqrt(n); i++) {
if (n % i === 0) return false;
}
return true;
}
console.log(isPrime(7)); // Output: trueπ Q4. Count vowels in a string.
β Answer:
function countVowels(str) {
return str.match(/[aeiou]/gi)?.length || 0;
}
console.log(countVowels("Hello World")); // Output: 3π Q5. Convert first letter of each word to uppercase.
β Answer:
let sentence = "hello world";
let titleCase = sentence.split(" ").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
console.log(titleCase); // Output: Hello World
π¬ Tap β€οΈ for Part 3!
β€11
5 Steps to Learn Front-End Developmentπ
Step 1: Basics
β Internet
β HTTP
β Browser
β Domain & Hosting
Step 2: HTML
β Basic Tags
β Semantic HTML
β Forms & Table
Step 3: CSS
β Basics
β CSS Selectors
β Creating Layouts
β Flexbox
β Grid
β Position - Relative & Absolute
β Box Model
β Responsive Web Design
Step 3: JavaScript
β Basics Syntax
β Loops
β Functions
β Data Types & Object
β DOM selectors
β DOM Manipulation
β JS Module - Export & Import
β Spread & Rest Operator
β Asynchronous JavaScript
β Fetching API
β Event Loop
β Prototype
β ES6 Features
Step 4: Git and GitHub
β Basics
β Fork
β Repository
β Pull Repo
β Push Repo
β Locally Work With Git
Step 5: React
β Components & JSX
β List & Keys
β Props & State
β Events
β useState Hook
β CSS Module
β React Router
β Tailwind CSS
Now apply for the job. All the best π
Step 1: Basics
β Internet
β HTTP
β Browser
β Domain & Hosting
Step 2: HTML
β Basic Tags
β Semantic HTML
β Forms & Table
Step 3: CSS
β Basics
β CSS Selectors
β Creating Layouts
β Flexbox
β Grid
β Position - Relative & Absolute
β Box Model
β Responsive Web Design
Step 3: JavaScript
β Basics Syntax
β Loops
β Functions
β Data Types & Object
β DOM selectors
β DOM Manipulation
β JS Module - Export & Import
β Spread & Rest Operator
β Asynchronous JavaScript
β Fetching API
β Event Loop
β Prototype
β ES6 Features
Step 4: Git and GitHub
β Basics
β Fork
β Repository
β Pull Repo
β Push Repo
β Locally Work With Git
Step 5: React
β Components & JSX
β List & Keys
β Props & State
β Events
β useState Hook
β CSS Module
β React Router
β Tailwind CSS
Now apply for the job. All the best π
β€7π5
Website Development Roadmap β 2025
πΉ Stage 1: HTML β Learn the basics of web page structure.
πΉ Stage 2: CSS β Style and enhance web pages (Flexbox, Grid, Animations).
πΉ Stage 3: JavaScript (ES6+) β Add interactivity and dynamic features.
πΉ Stage 4: Git & GitHub β Manage code versions and collaborate.
πΉ Stage 5: Responsive Design β Make websites mobile-friendly (Media Queries, Bootstrap, Tailwind CSS).
πΉ Stage 6: UI/UX Basics β Understand user experience and design principles.
πΉ Stage 7: JavaScript Frameworks β Learn React.js, Vue.js, or Angular for interactive UIs.
πΉ Stage 8: Backend Development β Use Node.js, PHP, Python, or Ruby to
build server-side logic.
πΉ Stage 9: Databases β Work with MySQL, PostgreSQL, or MongoDB for data storage.
πΉ Stage 10: RESTful APIs & GraphQL β Create APIs for data communication.
πΉ Stage 11: Authentication & Security β Implement JWT, OAuth, and HTTPS best practices.
πΉ Stage 12: Full Stack Project β Build a fully functional website with both frontend and backend.
πΉ Stage 13: Testing & Debugging β Use Jest, Cypress, or other testing tools.
πΉ Stage 14: Deployment β Host websites using Netlify, Vercel, or cloud services.
πΉ Stage 15: Performance Optimization β Improve website speed (Lazy Loading, CDN, Caching).
π Web Development Resources
ENJOY LEARNING ππ
πΉ Stage 1: HTML β Learn the basics of web page structure.
πΉ Stage 2: CSS β Style and enhance web pages (Flexbox, Grid, Animations).
πΉ Stage 3: JavaScript (ES6+) β Add interactivity and dynamic features.
πΉ Stage 4: Git & GitHub β Manage code versions and collaborate.
πΉ Stage 5: Responsive Design β Make websites mobile-friendly (Media Queries, Bootstrap, Tailwind CSS).
πΉ Stage 6: UI/UX Basics β Understand user experience and design principles.
πΉ Stage 7: JavaScript Frameworks β Learn React.js, Vue.js, or Angular for interactive UIs.
πΉ Stage 8: Backend Development β Use Node.js, PHP, Python, or Ruby to
build server-side logic.
πΉ Stage 9: Databases β Work with MySQL, PostgreSQL, or MongoDB for data storage.
πΉ Stage 10: RESTful APIs & GraphQL β Create APIs for data communication.
πΉ Stage 11: Authentication & Security β Implement JWT, OAuth, and HTTPS best practices.
πΉ Stage 12: Full Stack Project β Build a fully functional website with both frontend and backend.
πΉ Stage 13: Testing & Debugging β Use Jest, Cypress, or other testing tools.
πΉ Stage 14: Deployment β Host websites using Netlify, Vercel, or cloud services.
πΉ Stage 15: Performance Optimization β Improve website speed (Lazy Loading, CDN, Caching).
π Web Development Resources
ENJOY LEARNING ππ
β€5π2
π₯ $10.000 WITH LISA!
Lisa earned $200,000 in a month, and now itβs YOUR TURN!
Sheβs made trading SO SIMPLE that anyone can do it.
βοΈJust copy her signals every day
βοΈFollow her trades step by step
βοΈEarn $1,000+ in your first week β GUARANTEED!
π¨ BONUS: Lisa is giving away $10,000 to her subscribers!
Donβt miss this once-in-a-lifetime opportunity. Free access for the first 500 people only!
π CLICK HERE TO JOIN NOW π
Lisa earned $200,000 in a month, and now itβs YOUR TURN!
Sheβs made trading SO SIMPLE that anyone can do it.
βοΈJust copy her signals every day
βοΈFollow her trades step by step
βοΈEarn $1,000+ in your first week β GUARANTEED!
π¨ BONUS: Lisa is giving away $10,000 to her subscribers!
Donβt miss this once-in-a-lifetime opportunity. Free access for the first 500 people only!
π CLICK HERE TO JOIN NOW π
β€2
β
Top 5 Mistakes to Avoid When Learning Web Development ππ»
1οΈβ£ Skipping HTML/CSS Basics
Many rush to frameworks like React without understanding basic structure and styling. Master HTML and CSS first.
2οΈβ£ Not Practicing JavaScript Enough
JavaScript runs the web. Practice DOM manipulation, functions, and events daily to build strong logic.
3οΈβ£ Ignoring Responsive Design
If your site breaks on mobile, it's useless to half your users. Learn media queries and mobile-first design.
4οΈβ£ Copy-Pasting Code Without Understanding
You wonβt grow by copying. Break down every snippet. Understand what each line does.
5οΈβ£ No Real Projects
Watching tutorials isnβt enough. Build your own portfolio, blog, or e-commerce site to apply your skills.
π¬ Tap β€οΈ for more!
1οΈβ£ Skipping HTML/CSS Basics
Many rush to frameworks like React without understanding basic structure and styling. Master HTML and CSS first.
2οΈβ£ Not Practicing JavaScript Enough
JavaScript runs the web. Practice DOM manipulation, functions, and events daily to build strong logic.
3οΈβ£ Ignoring Responsive Design
If your site breaks on mobile, it's useless to half your users. Learn media queries and mobile-first design.
4οΈβ£ Copy-Pasting Code Without Understanding
You wonβt grow by copying. Break down every snippet. Understand what each line does.
5οΈβ£ No Real Projects
Watching tutorials isnβt enough. Build your own portfolio, blog, or e-commerce site to apply your skills.
π¬ Tap β€οΈ for more!
β€9π2