Learn JavaScript (the language and more) by doing it. Fix failing tests. Keep all learnings.
I learned ES6 by writing it and failing. Out of this the es6katas
evolved. And since, this allowed me to always again go back and
(re-)learn ES6 I wrote katas for ES8, later ES1 (I always got the
sort() function wrong). At some point I started to learn a
very expressive assertion library
hamjest by writing katas
for it, and so this page came about.
Enjoy and I hope you have fun learning with it.
Wolfram Kriesing
The `sort()` function sorts an array as if each element was a string.
Difficulty: beginnerPassing a callback to the `sort()` function, allows for any custom sorting.
Difficulty: intermediateThe `indexOf()` method returns the first index at which a given element can be found in the array
Difficulty: beginner`Number.isInteger()` determines if a value is an integer.
Difficulty: beginner`Number.isNaN()` determines if a value is `NaN`.
Difficulty: beginner`Number.parseInt()` parses a string and returns an integer.
Difficulty: beginnerConvert a not-array into an array.
Difficulty: tbd`Array.of` creates an array with the given arguments as elements.
Difficulty: tbd`[].fill` can fill up an array with one value.
Difficulty: tbd`[].find` makes finding items in arrays easier.
Difficulty: tbd`[].findIndex` makes finding items in arrays easier.
Difficulty: tbd`[].entries()` returns an iterator object with all entries.
Difficulty: intermediate`[].keys()` returns an iterator for all keys in the array.
Difficulty: intermediate`[].values()` returns an iterator for all values in the array
Difficulty: intermediateGetter+setters as class properties.
Difficulty: intermediateMore in depth `extends` stuff
Difficulty: advancedUse of `super` inside a method.
Difficulty: intermediateUse of `super` inside the constructor.
Difficulty: intermediateDestructuring objects is a core concepts for modules and more.
Difficulty: beginnerWhen destructuring you can also use default values.
Difficulty: beginnerDestructuring function parameters.
Difficulty: intermediateAssign variables while destructuring.
Difficulty: intermediateThere are many ways to create a generator
Difficulty: tbdGenerators return iterable objects
Difficulty: tbdThe yield keyword is used to pause and resume a generator function
Difficulty: tbdBy calling next() with a parameter, you can pass a value to a generator.
Difficulty: advancedBy calling next() with a function, you can pass it to the generator.
Difficulty: expertReturn statement in a generator function is special.
Difficulty: advancedInitializing a map with values.
Difficulty: advancedIndicates whether an element with a key exists.
Difficulty: beginnerA promise represents an operation that hasn`t completed yet, but is expected in the future.
Difficulty: beginnerA promise can be created in multiple ways, learn them all here.
Difficulty: intermediateChaining promises can enhance readability of asynchronous code.
Difficulty: advanced`Promise` API overview.
Difficulty: intermediateReturns a Promise and deals with rejected cases only.
Difficulty: intermediateCalls a target function with given scope and arguments.
Difficulty: intermediateIt returns the prototype of the given object.
Difficulty: intermediateThe `new` operator as a function.
Difficulty: intermediateDefines a property on a given object.
Difficulty: intermediateAppends a new element to the end of a Set object.
Difficulty: tbdRemoves an element from a set.
Difficulty: beginnerRemoves all elements from a Set object.
Difficulty: beginnerES6 has new shorthands for objects.
Difficulty: intermediateObject literal properties may be computed values.
Difficulty: advancedA getter binds an object property to a function that will be called when that property is looked up.
Difficulty: beginnerA setter binds an object property to a function to be called when there is an attempt to set that property.
Difficulty: beginnerFinds string within another string.
Difficulty: beginnerAppends `count` copies of `string` to each other and returns it.
Difficulty: beginnerDetermines whether a string begins with the characters of another string.
Difficulty: beginnerDetermines whether a string begins with the characters of another string.
Difficulty: beginnerA template string, is wrapped in backticks.
Difficulty: beginnerTemplate strings, can be multiline.
Difficulty: beginnerAdvanced form of template strings.
Difficulty: intermediateThe `raw` property accesses the string as it was entered.
Difficulty: intermediateSymbol basics.
Difficulty: intermediate`Symbol.for()` for registering Symbols globally.
Difficulty: intermediate`Symbol.keyFor()` gets the symbol key for a given symbol.
Difficulty: intermediateArrow functions are a more convinient and shorter way to write a function.
Difficulty: beginnerArrow functions have lexical `this`, no dynamic `this`.
Difficulty: beginner`let` restricts the scope of the variable to the current block.
Difficulty: beginner`const` is like `let` plus read-only.
Difficulty: beginnerUse the rest operator as parameter.
Difficulty: intermediateUse the rest operator with destructuring.
Difficulty: intermediateSpread syntax in use with arrays.
Difficulty: intermediateSpread syntax in use with strings.
Difficulty: intermediateDefault parameters make function parameters more flexible.
Difficulty: beginnerUse `import` to import functions that have been exported somewhere else.
Difficulty: beginner`Object.is()` compares if two values are the same.
Difficulty: beginnerHow to use unicode in strings.
Difficulty: intermediate`Object.fromEntries()` converts key-value pairs into an object
Difficulty: intermediate`Object.fromEntries()` converts key-value pairs into an object
Difficulty: expertThe strict version of `equalTo()`, just like the `===`.
Difficulty: beginnerThe matcher `anything()`, matches any value and never fails.
Difficulty: beginnerThe matcher `defined()`, matches everything but `undefined`.
Difficulty: beginnerThe core function needed for most assertions.
Difficulty: beginner