JAVASCRIPT PROGRAMMING
3.68K subscribers
494 photos
3 videos
48 files
102 links
Hello! I am @imabhi3030 and welcome to the Coding channel! Here we can learn all things related to coding and improve our skills. I am always present to help you. If you need any kind of assistance, just let me know! 😊
Download Telegram
🔰 DOM Manipulation

For DOM manipulation, we use JavaScript to access, modify, or create these elements, making our web pages come alive without the need to reload them.


In this post we are going to look at:
Create Elements
Insert an elements
Modifying Contents
Replacing Elements
Remove Elements
Updating Element Attributes

DOM manipulation empowers developers to create dynamic and interactive web experiences.

Mastering methods like inserting, removing, replacing elements, updating attributes enables seamless user interactions.
1
CHALLENGE

function createCounter() {
let count = 0;
return {
increment: () => ++count,
decrement: () => --count,
get: () => count
};
}

const counter1 = createCounter();
const counter2 = createCounter();
counter1.increment();
counter1.increment();
counter2.increment();
console.log(counter1.get(), counter2.get());
const { increment, get } = counter1;
increment();
console.log(get());
What is the output?
Anonymous Quiz
49%
2 1 3
24%
2 1 4
21%
3 1 4
7%
3 2 3
4
🔰 JavaScript Array Methods
3
CHALLENGE

const promise1 = Promise.resolve('first');
const promise2 = new Promise(resolve => {
resolve('second');
});

const promise3 = Promise.resolve().then(() => 'third');

async function test() {
console.log('start');

const result1 = await promise1;
console.log(result1);

const result2 = await promise2;
console.log(result2);

const result3 = await promise3;
console.log(result3);

console.log('end');
}

test();
🌚1
Build safer JS + WASM hybrids. Wrap WebAssembly calls inside JavaScript error boundaries for reliable, crash free execution.
2