© 2026 Hashnode
for..in v/s for...of: By using the for..in i get the indexes only but with the help of those indexes i can get the values at that index. By using the for...of I can only get the value only values directly I don’t get the indexes. <script> let ar...

Hey folks, I had a bit of a "Eureka!" moment today while working with JavaScript arrays. If you’ve ever used slice and splice, you might have wondered what exactly sets them apart. Well, I dug into it and thought I’d share what I found. Let’s dive ri...

● String length ● String slice() ● String substring() ● String substr() ● String replace() ● String replaceAll() ● String toUpperCase() ● String toLowerCase() ● String concat() String Length:- ● String trim() ● String trimStart() ● String tr...

Consider of a case in JavaScript var a = [1,2,3,4,5]; var b = a; b.pop(); console.log(b);// output will be [1,2,3,4] console.log(a);// surprisingly output will be [1,2,3,4] The same is true with objects (as arrays themselves are a type of object). B...
