array.splice(index, count, item1, ....., itemX)
index => Required. The index (position) to add or remove items. A negative value counts from the end of the array.
count => Optional. Number of items to be removed.
item1, ..., => Optional. The new elements(s) to be added.
const fruits = ["Banana", "Orange", "Apple", "Mango"];
// At position 2, remove 1 item, add "Lemon" and "Kiwi"
fruits.splice(2, 1, "Lemon", "Kiwi"); // ["Banana", "Orange", "Lemon", "Kiwi", "Mango"]
## 🚀 **Top 10 JavaScript Concepts Every Developer Should Know!**
💛 JavaScript is the heart of web development — mastering its core concepts makes you a real problem-solver! Let’s quickly revisit some powerful fundamentals 👇
---
### 🧩 1️⃣ **Variables (`var`, `let`, `const`)**
* `var` → Function-scoped
* `let`, `const` → Block-scoped
* Use `const` when the value won’t change.
```js
let name = "Vijaya";
const age = 25;
```
---
### ⚡ 2️⃣ **Hoisting**
Variables and functions are moved to the top of their scope before execution.
```js
console.log(x); // undefined
var x = 5;
```
---
### 🌀 3️⃣ **Closures**
A function “remembers” the variables from its parent scope — even after the parent is gone!
```js
function outer() {
let count = 0;
return function inner() {
count++;
console.log(count);
};
}
const counter = outer();
counter(); // 1
counter(); // 2
```
---
### 🧠 4️⃣ **Promises & Async/Await**
Handle asynchronous code neatly.
```js
async function getData() {
const data = await fetch('https://api.example.com');
console.log('Data loaded!');
}
```
---
### 🧮 5️⃣ **Array Methods**
Powerful one-liners for clean code:
* `map()` – transform data
* `filter()` – filter elements
* `reduce()` – combine values
```js
let nums = [1,2,3];
let doubled = nums.map(n => n*2);
```
---
### 🔁 6️⃣ **Callback Functions**
A function passed as an argument to another function.
```js
function greet(name, callback) {
callback(`Hello ${name}`);
}
greet("Vijaya", console.log);
```
---
### 🧱 7️⃣ **Objects & Destructuring**
Extract values easily:
```js
const user = {name: "Vijaya", age: 22};
const {name, age} = user;
```
---
### 🔥 8️⃣ **ES6 Features**
Modern JavaScript = cleaner syntax!
✅ Template literals
✅ Arrow functions
✅ Spread & Rest operators
✅ Modules
```js
const arr = [1, 2];
const newArr = [...arr, 3];
```
---
### 🧭 9️⃣ **Event Loop**
JS is single-threaded but handles async tasks smartly.
📚 Tasks go to the callback queue and execute when the main thread is free.
---
### 💥 🔟 **DOM Manipulation**
Make your webpage dynamic!
```js
document.getElementById("demo").innerText = "Hello JS!";
```
---
### ✨ **Final Thought**
> “Knowing syntax is easy — understanding concepts makes you a real developer.”
Keep practicing, keep building 💪
#JavaScript#WebDevelopment#CodingJourney#LearnWithMe#FrontendDeveloper#LinkedInLearning#100DaysOfCodeAjay Babu Sappa10000 Coderssanjeev chManivardhan Jakka
💻✨ JavaScript Function Practice – Task Completed!
This week, I focused on improving my function-building skills in JavaScript through hands-on coding challenges. Each task helped me apply logic, handle edge cases, and write cleaner, reusable code.
Here’s what I worked on 👇
🟢 1. Greeting Function
greetUser(name, times) — Greets a user multiple times and shows a warning if the count is invalid.
🟢 2. Rectangle Area & Perimeter
calcRectangle(width, height) — Returns both area and perimeter of a rectangle, with error handling for invalid dimensions.
🟢 3. Flexible String Repeater
repeatString(str, count, separator) — Builds a repeated string with a custom or default separator.
🟢 4. Parameterized Filter Function
filterByLength(wordList, minLen, maxLen) — Filters an array of strings based on minimum and maximum word lengths, automatically swapping limits if needed.
🟢 5. Parameterized Calculator Function
calculate(a, b, operation) — Performs add, subtract, multiply, or divide operations with smart error handling for zero division or invalid inputs.
Each task strengthened my understanding of:
✅ Function parameters & return values
✅ Error handling & validation
✅ Logical problem-solving
💬 Excited to keep practicing and building more JavaScript-based utilities!
#JavaScript#CodingPractice#WebDevelopment#ProblemSolving#LearnToCode#Functions#DeveloperJourney#JS#Coding#Coding#10000coders#spandanachowdary#MeghanaM
8 JavaScript topics that actually matter
Been coding for a while now, these keep coming up:
→ Closures
Functions that remember their context. Used everywhere in React hooks and callbacks.
→ Promises & Async/Await
Writing code that waits without freezing. Essential for API calls.
→ Array Methods
map(), filter(), reduce(). Clean data manipulation.
→ Event Loop
How JavaScript handles async ops. Makes everything click once you get it.
→ Destructuring
Cleaner way to pull values from objects and arrays. Saves a lot of lines.
→ Spread/Rest Operators
Copy arrays, merge objects, handle function params. Super useful.
→ Prototypes & Inheritance
How objects actually work under the hood. Important for interviews.
→ Module Systems
Import/export between files. Keeps code organized.
These aren't flashy. But knowing them makes everything easier.
What topic gave you the most trouble when learning JS?
#JavaScript#Coding#WebDevelopment#100DaysOfCode#LearnToCode#FrontendDevelopment#MERNStack#DeveloperTips
🔥 JS Dev → Strongly Typed Language: The Pain Is Real
As a JavaScript developer, I lived in functions, callbacks, and the classic:
“Just run it and see what breaks.” 😅
Then I switched to a strongly typed language…
and suddenly everything hit at once:
⚠️ Interfaces everywhere
⚠️ Abstract classes you can’t ignore
⚠️ Constructors for every dependency
⚠️ Generics staring at you like a warning sign
⚠️ Repository + Service layers (even for simple features!)
⚠️ DTOs for tiny inputs
⚠️ Dependency Injection running the whole system
⚠️ Compile-time errors before you even run code
Coming from JS, it feels like the language is fighting you —
too many layers, too many rules, too many types.
But then… it clicks. ✅
✨ Your code becomes cleaner
✨ Your architecture finally makes sense
✨ Your bugs drop significantly
✨ Your confidence grows with every file you write
JavaScript gives you speed.
Strongly typed languages give you structure.
Mastering both?
That makes you dangerous as a developer. 🚀
#JavaScript#TypeScript#SoftwareDevelopment#Programming#DeveloperLife#Coding#CareerGrowth
🚀 Level Up Your JavaScript Game!
Mastering JavaScript isn’t just about writing code — it’s about knowing the tools built right into the language 💡
Here’s a quick visual guide to some powerful built-in functions that every developer should know 👇
🧮 Math Functions: Rounding, Random Numbers, Square Roots, and more.
🧵 String Functions: Manipulate text effortlessly with .toUpperCase(), .replace(), and .indexOf().
📦 Array Functions: Sort, filter, and transform data like a pro with .map(), .filter(), and .reduce().
⏰ Date Functions: Handle time and dates with ease using .now() and .toISOString().
Whether you’re just starting out or brushing up your skills, mastering these will save time and make your code cleaner, faster, and smarter ⚡
💬 What’s your most-used JavaScript built-in function? Drop it in the comments 👇
#JavaScript#WebDevelopment#Coding#Frontend#Programming#Developers#ReactJS#100DaysOfCode
👉✅ “Setting a one-week goal to revise JavaScript again.”
💻Topic-1. JavaScript Constructor Function
Hey everyone, 👋
Today, let’s talk about an interesting JavaScript topic — the Constructor Function.
This is a special type of function that helps us create multiple similar objects without writing the same code again and again! 🔁
🧠 Key points to understand:
The name of a constructor function always starts with a capital letter.
We use the new keyword when creating an object.
It automatically returns a new object.
Through this concept, we can explore the basics of Object-Oriented Programming (OOP) in JavaScript — including concepts like inheritance and encapsulation.
🚀 If you’re learning JavaScript, understanding constructor functions is a must-have skill — it makes your code cleaner, reusable, and more efficient!
#JavaScript#WebDevelopment#CodingTips#ConstructorFunction#FrontendDevelopment#LearningEveryday
array.splice(index, count, item1, ....., itemX) index => Required. The index (position) to add or remove items. A negative value counts from the end of the array. count => Optional. Number of items to be removed. item1, ..., => Optional. The new elements(s) to be added. const fruits = ["Banana", "Orange", "Apple", "Mango"]; // At position 2, remove 1 item, add "Lemon" and "Kiwi" fruits.splice(2, 1, "Lemon", "Kiwi"); // ["Banana", "Orange", "Lemon", "Kiwi", "Mango"]