**Homework**
How would you "read" the second result from the generator?
Or practice the yield expression and many more things on:
All the katas β https://jskatas.org
Kata on generators β https://jskatas.org/katas/es6/language/generator/yield/
**Homework**
How would you "read" the second result from the generator?
Or practice the yield expression and many more things on:
All the katas β https://jskatas.org
Kata on generators β https://jskatas.org/katas/es6/language/generator/yield/
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.
1οΈβ£ The property `function.length` indicates the number of parameters a function expects
WHEN reading `length` of a function without parameters
THEN it is 0
WHEN a function is defined with two parameters
THEN length reports 2
WHEN calling the function with 0 parameters
THEN the length still indicates the expected number of parameters
Here we go two #JavaScript katas #jskatas about `function.length`
ES1: https://jskatas.org/katas/es1/language/function-api/length/
ES6: https://jskatas.org/katas/es6/language/function-api/length/
Interesting, `array.shift()` was introduced in ECMAScript 3 [1] in 1999, see chapter 15.4.4.9. At least it's not part of the v2 spec [2] from 1998. In v2 the last chapter in 15.4.4 is 15.4.4.5.
Expect a #jskata on `array.shift()` to come soon.
[1] https://www.ecma-international.org/wp-content/uploads/ECMA-262_3rd_edition_december_1999.pdf
[2] https://www.ecma-international.org/wp-content/uploads/ECMA-262_2nd_edition_august_1998.pdf
π You're a newbie, JSKatas takes you by the hand and helps you learn at your speed! Start with an easy kata [1] to get the hang of it and find out if you like it. For example learn how to declare a variable [2].
[1] https://jskatas.org/katas/groups/level-easy/
[2] https://jskatas.org/katas/es6/language/block-scoping/const/
I released one new kata, a kata about `String.raw`. π
β What is it?
`String.raw` is a tag function for a template literal, which returns the raw string, e.g. \\n (not \n) for a line break. [1]
π§ I find it hard to explain what it is. I also feel this is a very edge case thing, just like Reflect, not many seem to know and use it.
Feedback is very welcome.
A new #jskatas rabbit hole found `String.raw`.
Actually I was trying to understand and improve the template-strings-raw kata [1], but that led me to learn (again) what `String.raw` [2] is actually good for, and even more important why the array of strings passed to a tag-function gets a `raw` property.
β How much relevance does this feature have? π€·π»ββοΈ
π§π½βπ Anyways, I like digging into it to understand it. π‘
[1] https://jskatas.org/katas/es6/language/template-strings/raw/
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw
Hab mir mal den Schedule der c't webdev @ctwebdev angeschaut https://ctwebdev.de/agenda2023/ und ich bin immer wieder ziemlich irritiert wie wenig Rolle eigentlich JavaScript als Sprache spielt, es geht immer um alles was oben drauf gesetzt wird.
Aber gut, umsonst mache ich ja nicht sowas wie #jskatas und #jslang, weil ich denke dass zuviel Potential, das mit der Sprache noch ausgeschΓΆpft werden kΓΆnnte, auf der Strecke bleibt.
...
We're all about getting your hands dirty with real-world coding challenges! π€
https://jskatas.org
π― Sharpen Your #Skills with Focused Drills π―
Consolidate your existing knowledge and push your skills to the next level! π
Take Control of Your Learning Journey #JSKatas empowers you to actively engage with #JavaScript, offering a learning experience that's as unique as you are! π
https://jskatas.org
π In the new https://jskatas.org one can edit the tests right on the page now.
βΉοΈ This allows you to stay focused and keep the kata in sight and finish right where you learn.
ποΈ The mission of #jskatas is to allow to continuously #learn #JavaScript your way.
π§ͺ Using tests π
Three new katas about "Bitwise Shift Operators" have just been released to #jskatas
- All bitwise shift operators
- Left Shift "<<"
- Right Shift ">>"
it('shifting BigInt can be any huge number, even larger than 32bits', () => {
const bigInt = 1n << 255n;
assert.equal(bigInt.toString(2), '100000000000000000000000000000000000000000000000000000000000000.......');
});
Follow me into a new rabbit hole.
I am starting a kata (or many katas) on bit shifting (operations/operators). I am working on a lot of C code during the day where this is a usual thing to do and I often struggle with understanding the reasoning, so I thought why not just write it for #jskatas.
tbc
Online I see there are three #jskatas on unary operators [1] for #JavaScript, and in the repo I see that I have bigger plans, at least six seem to be prepared.
Looks like I am good in filling a backlog.
I vaguely remember how deep the rabbit hole started to look when I wrote "What's an "Unary" Operator?" [2].
[1] https://jskatas.org/katas/versions/chronological/#bundle-es1-katas
[2] https://jskatas.org/blog/2021/02/06-what-is-a-unary-operator/
I had not remembered that I did actually already create one #BigInt #kata to learn the basics of it.
In #ES11 or #ES2020 or just #JavaScript 2 years ago it was released. Wanna learn it too? Feel free to fix some failing tests and hopefully learn actively how BigInt works.
#JSKatas Explained
Website
https://jskatas.org/blog/2021/01/09-jskatas-explained/