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

#JavaScript #learning #withTests

`raw` property

A kata to (re-)learn about Template strings | `raw` property | The `raw` property accesses the string as it was entered. | 5 tests to solve | Difficulty Level: INTERMEDIATE

JavaScript Katas - Continuously Learn JavaScript. Your Way.

That [1] is what I came up with as a kata for understanding how `raw` can be used inside a template tag function. 💥 Already this sentence contains so much context and things one needs to understand, and the kata even more. Difficult. 😞
And on top, I have to understand `String.raw` myself first before even properly offering this kata to the world, which leads me to write a `String.raw` kata. Surprise I didn't have one yet.

[1] https://codeberg.org/wolframkriesing/javascript-katas/src/branch/main/katas/es6/language/template-strings/raw.js

#JavaScript #learning #tests

javascript-katas

These are the katas used on jskatas.org, but they can also be used without the site to learn JS.

Codeberg.org

Have you ever read/used the #JavaScript specification?
There are quite some neat things to discover that make it easier to read it. Just click any parameter. This helps so much with reading the spec. See for example the `String.raw` chapter below https://tc39.es/ecma262/#sec-string.raw

If you want to learn to read the spec, this article is great https://timothygu.me/es-howto/

I am #learning along with ChatGPT or they is learning with me, not sure :)

I hope from now on #ChatGPT gives you better answers (about #JavaScripts `String.raw` LOL)

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.

[1] https://jskatas.org/katas/es6/language/string-api/raw/

#JavaScript #learning #tests #jskatas

`String.raw`

A kata to (re-)learn about String API | `String.raw` | `String.raw` is a tag function for a template literal, which returns the raw string, e.g. \n (not ) for a line break. | 8 tests to solve | Difficulty Level: ADVANCED

JavaScript Katas - Continuously Learn JavaScript. Your Way.