I released my first article aimed at those new to #JavaScript, titled 'Learning JavaScript Arrays.' It adopts a test-driven style, inviting readers to solve small tests within the article.

👉 https://jskatas.org/blog/2023/09/29-learn-arrays/?source=mastodon

I saw the array section on jskatas be most used, so I thought maybe lets dive a bit deeper and I brought arrays, the knowledge and the test approach together. What do you think? I would love to get feedback.

#learning #JavaScript #jskatas #tests #testdriven

Learning JavaScript Arrays

An array is like a queue where you can have zero, one or many values. The first value can be found at index 0, and others follow. An empty array, like a queue with no one in it, is written in JavaScript as `[]`. The `[` and `]` are the start and end markers, and items inside are separated by commas.For example, to make an array with the numbers 0 to 3, you write `[0, 1, 2, 3]`.

JavaScript Katas - Continuously Learn JavaScript. Your Way.

@wolframkriesing The test-driven approach is a great idea, and I like how you use new array methods. Comparing an array to a queue creates a clear visual too.

It might be a good idea to start with the queue visual, then go right into a simple test that fails (because there's no queue): assert(myQueue.length === 3). Then make that queue to make the test pass.

Two more suggestions: eliminate 'history talk', don't say 'many ways to create arrays' without covering other ways.

Keep it up!

@chrisminnick thanks for the in depth look at it.
The history talk is not useful I agree, at least without giving more context.