en
Feedback
JAVASCRIPT_PROGRAMMING

JAVASCRIPT_PROGRAMMING

Open in Telegram

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! 😊

Show more
The country is not specifiedTechnologies & Applications103 796
284
Subscribers
+724 hours
+977 days
+25530 days
Posts Archive
Subscribe our channel for coding, design, programming, Coreldraw, Excel, termux hacking, python animation, and more Subscribe
Subscribe our channel for coding, design, programming, Coreldraw, Excel, termux hacking, python animation, and more Subscribe please - 👉✅ https://youtube.com/@CODEBOMBS

NOTE - Alpha delta and supreme batch course are include in this channel Free for all 😁feel free to ask @imabhi3030 Javascript full course - https://t.me/Javascript_Course_js full stack web devloper course - https://t.me/web_devloper_bro Ethical hacking full course - https://t.me/Ethical_hackings_course Reacts & nodejs full course - https://t.me/Reacts_Course Linux full course - https://t.me/Linux_Courses Python devloper full course - https://t.me/Python_Devloper Machine learning & ai course - https://t.me/Machine_learnings_Ai Android apps devloper full course - https://t.me/Mobile_Apps_devlopment JOIN ALL IMPORTANT COURSE - 👉🏻 https://t.me/addlist/c3QWwWR-Iw4xMDNl

// 20. find()
let arrFind = [1, 2, 3, 4, 5];
let found = arrFind.find(element => element > 2);
console.log(found); // Output: 3

// 19. sort()
let arrSort = [3, 1, 2];
arrSort.sort();
console.log(arrSort); // Output: [1, 2, 3]

// 18. reverse()
let arrReverse = [1, 2, 3];
arrReverse.reverse();
console.log(arrReverse); // Output: [3, 2, 1]

// 17. join()
let arrJoin = [1, 2, 3];
let joined = arrJoin.join('-');
console.log(joined); // Output: "1-2-3"

// 16. some()
let arrSome = [1, 2, 3, 4, 5];
let isSome = arrSome.some(element => element > 4);
console.log(isSome); // Output: true

// 15. every()
let arrEvery = [1, 2, 3, 4, 5];
let isEvery = arrEvery.every(element => element > 0);
console.log(isEvery); // Output: true

// 14. reduce()
let arrReduce = [1, 2, 3, 4, 5];
let reduced = arrReduce.reduce((accumulator, currentValue) => accumulator + currentValue);
console.log(reduced); // Output: 15

// 13. filter()
let arrFilter = [1, 2, 3, 4, 5];
let filtered = arrFilter.filter(element => element > 2);
console.log(filtered); // Output: [3, 4, 5]

// 12. map()
let arrMap = [1, 2, 3];
let mapped = arrMap.map(element => element * 2);
console.log(mapped); // Output: [2, 4, 6]

// 11. forEach()
let arrForEach = [1, 2, 3, 4, 5];
arrForEach.forEach(element => {
  console.log(element);
});
// Output: 1, 2, 3, 4, 5 (each element on a new line)

// 10. includes()
let arrIncludes = [1, 2, 3, 4, 5];
let included = arrIncludes.includes(3);
console.log(included); // Output: true

// 9. lastIndexOf()
let arrLastIndexOf = [1, 2, 3, 4, 5, 4];
let lastIndex = arrLastIndexOf.lastIndexOf(4);
console.log(lastIndex); // Output: 5

// 8. indexOf()
let arrIndexOf = [1, 2, 3, 4, 5, 4];
let index = arrIndexOf.indexOf(4);
console.log(index); // Output: 3

// 7. concat()
let arrConcat1 = [1, 2, 3];
let arrConcat2 = [4, 5];
let concatenated = arrConcat1.concat(arrConcat2);
console.log(concatenated); // Output: [1, 2, 3, 4, 5]

// 6. slice()
let arrSlice = [1, 2, 3, 4, 5];
let sliced = arrSlice.slice(1, 4);
console.log(sliced); // Output: [2, 3, 4]

// 5. splice()
let arrSplice = [1, 2, 3, 4, 5];
arrSplice.splice(2, 1, 'a', 'b');
console.log(arrSplice); // Output: [1, 2, 'a', 'b', 4, 5]

// 4. unshift()
let arrUnshift = [1, 2, 3];
arrUnshift.unshift(-3, -2, -1, 0);
console.log(arrUnshift); // Output: [-3, -2, -1, 0, 1, 2, 3]