Nodebook

Check JavaScript katas with frontend tool tddbin

In this blog post, we will discuss how to use tddbin to check your JavaScript katas. Tddbin is a frontend tool that allows you to write and test your code in the browser. It is a great way to get feedback on your code and learn new techniques.

TddBin features

In addition to checking your code, tddbin also provides several other features, such as:

  • A code editor with syntax highlighting
  • A debugger
  • A test runner
  • A documentation generator

Tddbin is a great tool for both beginners and experienced JavaScript developers. It is a great way to improve your coding skills and learn new techniques.

Check with functional example create a curry function

One of the great things about tddbin is that it can be used to check your code with functional programming techniques. For example, you can use tddbin to check your code for currying.

Currying is a technique in functional programming that allows you to create a function that takes multiple arguments and returns a function that takes the remaining arguments. For example, the following code shows how to create a curry function that adds two numbers:

function add(x, y) {
  return x + y;
}

const addCurry = x => y => x + y;

To check your code for currying, you can use the following tddbin test:

test('addCurry is a curry function', () => {
  expect(addCurry(1)(2)).toBe(3);
});

And here solution for this kata

let curry = (func) => {
  return function curried(...args) {
   if (args.length >= func.length) {
     return func.apply(this, args);
   } else {
     return function(...args2) {
       return curried.apply(this, args.concat(args2));
     }
   }
 }
};
Solve currying is a technique in functional programming in the tddbin

JsKatas.org

jskatas.org is a website that provides JavaScript katas, which are coding challenges that help you practice your JavaScript skills. The website uses tddbin to check your katas, so you can be sure that your code is correct. Here is my blog post about jskatas.org

Useful another resources

In addition to tddbin, there are some other resources that you can use to check your JavaScript katas. Some of these resources include:


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.