For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.
It makes sense to start learning by reading and watching videos about fundamentals and how things work.
Data Science and Machine Learning - 16 wks
Full-Stack Software Developer - 16w
Search from all Lessons
Curated list of small interactive and incremental exercises you can take to get better at any coding skill.
Curated section of projects to build while learning with simple instructions, videos, solutions, and more.
Guides on different topics related to the technologies that we teach in our courses
Social & live learning
The most efficient way to learn: Join a cohort with classmates just like you, live streams, impromptu coding sessions, live tutorials with real experts, and stay motivated.
The best way to check if an array is empty is by accessing the length property of the array.
In this example, we first verify that the array is of type array with the expression
Array.isArray(n), because if it was another type of data, for example, an object we couldn't access the length property, then we verify that the array is empty with the expression
n.length === 0.
In this example, we assigned a new empty array
 to the n array, removing all its elements.
It is important to have in mind that if you use the const keyword to create the array, this syntax won't work for emptying an array because the constants can't be modified as in the array example m.
The splice method allows you to remove the elements of an array from a specific index, this method receives 2 numeric parameters, the first is the index from which you want to start removing elements, the second parameter is the number of elements you want to remove.
Finally, another option to empty an array is by using the
while() loop removes all the elements of the array one by one.