Blog

Page 744 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Why is using "for...in" for array iteration a bad idea?
arraysfor-loopiterationjavascriptloops

Why is using "for...in" for array iteration a bad idea?

Published on September 2, 2023

# Why is using "for...in" for array iteration a bad idea? πŸš«πŸ”„ So, you've been told not to use `for...in` with arrays in JavaScript, huh? Good on you for seeking answers! πŸ€“ It's important to understand why certain practices are discouraged in order to wri

Cover Image for Get the last item in an array
arraysjavascript

Get the last item in an array

Published on September 2, 2023

# πŸ“ The Ultimate Guide to Getting the Last Item in an Array in JavaScript πŸš€ So, you're working on some JavaScript code and you need to get the last item in an array. But wait, there's a twist! You want to check if the last item is `"index.html"`, and if

Cover Image for Find object by id in an array of JavaScript objects
array-of-dictarraysjavascriptjavascript-objects

Find object by id in an array of JavaScript objects

Published on September 2, 2023

# Finding an Object by ID in a JavaScript Array: A Simple Guide Are you struggling to find an object in a JavaScript array based on its ID? Don't worry, you're not alone! In this post, we'll explore a common issue faced by developers and provide easy solu

Cover Image for Copy array by value
arraysjavascriptpass-by-value

Copy array by value

Published on September 2, 2023

## πŸ’‘ Copy Array By Value in JavaScript Copying an array in JavaScript seems like a straightforward task, but it can often lead to unexpected results. The default behavior of assigning an array to a new variable is that both variables reference the same u

Cover Image for How do I check if a variable is an array in JavaScript?
arraysjavascriptlistvariables

How do I check if a variable is an array in JavaScript?

Published on September 2, 2023

πŸ“ Blog Post: "Is it an Array or Nah? Check Variables with JavaScript!" πŸ‘‹ Hey there, JavaScript enthusiasts! Have you ever found yourself scratching your head wondering how to check if a variable is an array in JavaScript? πŸ€” Don't worry, you're not alon

Cover Image for How can I export GitHub issues to Excel?
excel

How can I export GitHub issues to Excel?

Published on September 2, 2023

πŸ“ **Tech Blog**: Exporting GitHub Issues to Excel made easy! πŸ˜ŽπŸš€ Are you tired of searching high and low for a way to export all your issues from your Enterprise GitHub repository to an Excel file? πŸ€” Well, you've come to the right place! In this blog p

Cover Image for Short circuit Array.forEach like calling break
arraysforeachjavascript

Short circuit Array.forEach like calling break

Published on September 2, 2023

# πŸ’₯ Short Circuit `Array.forEach` like calling `break` Have you ever wanted to prematurely exit a loop in JavaScript when using the `forEach` method? Maybe you've tried using `return;`, `return false;`, or even the infamous `break` keyword, but none of t

Cover Image for How do I empty an array in JavaScript?
arraysjavascript

How do I empty an array in JavaScript?

Published on September 2, 2023

# How to Empty an Array in JavaScript πŸ—‘οΈ So you have an array in JavaScript and you want to clear out all its elements, but you're not quite sure how to do it. Fear not! πŸ¦Έβ€β™‚οΈ In this blog post, I'll explain various methods to help you empty an array in

Cover Image for How to create an array containing 1...N
arraysjavascriptrange

How to create an array containing 1...N

Published on September 2, 2023

# How to Create an Array Containing 1...N in JavaScript πŸ€”πŸ’‘ Are you tired of using a loop to create an array containing numbers from 1 to N in JavaScript? Do you want a simpler, more efficient way to achieve the same result? Well, you're in luck! In this

Blog | Matheus Mello