// def hello_world(world): // if world == True: // return "Hello World baby" // elif world == False: // return "No World" helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
def hello_world(world):if world == True:return "Hello World baby"elif world == False:return "No World"- // def hello_world(world):
- // if world == True:
- // return "Hello World baby"
- // elif world == False:
- // return "No World"
- helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
// Since Node 10, we're using Mocha. // You can use `chai` for assertions. const chai = require("chai"); const assert = chai.assert; // Uncomment the following line to disable truncating failure messages for deep equals, do: // chai.config.truncateThreshold = 0; // Since Node 12, we no longer include assertions from our deprecated custom test framework by default. // Uncomment the following to use the old assertions: // const Test = require("@codewars/test-compat"); describe("Solution", function() { it("should test for something", function() { // Test.assertEquals(1 + 1, 2); // assert.strictEqual(1 + 1, 2); }); });
import codewars_test as test# TODO Write testsimport solution # or from solution import example- // Since Node 10, we're using Mocha.
- // You can use `chai` for assertions.
- const chai = require("chai");
- const assert = chai.assert;
- // Uncomment the following line to disable truncating failure messages for deep equals, do:
- // chai.config.truncateThreshold = 0;
- // Since Node 12, we no longer include assertions from our deprecated custom test framework by default.
- // Uncomment the following to use the old assertions:
- // const Test = require("@codewars/test-compat");
# test.assert_equals(actual, expected, [optional] message)@test.describe("Example")def test_group():@test.it("test case")def test_case():test.assert_equals(1 + 1, 2)- describe("Solution", function() {
- it("should test for something", function() {
- // Test.assertEquals(1 + 1, 2);
- // assert.strictEqual(1 + 1, 2);
- });
- });
// # def multiply (a,b): // # return a * b multiply = (a, b) => a * b;
def multiply (a,b):return a * b- // # def multiply (a,b):
- // # return a * b
- multiply = (a, b) => a * b;
// Since Node 10, we're using Mocha. // You can use `chai` for assertions. const chai = require("chai"); const assert = chai.assert; // Uncomment the following line to disable truncating failure messages for deep equals, do: // chai.config.truncateThreshold = 0; // Since Node 12, we no longer include assertions from our deprecated custom test framework by default. // Uncomment the following to use the old assertions: // const Test = require("@codewars/test-compat"); describe("Solution", function() { it("should test for something", function() { // Test.assertEquals(1 + 1, 2); // assert.strictEqual(1 + 1, 2); }); });
import codewars_test as test# TODO Write testsimport solution # or from solution import example- // Since Node 10, we're using Mocha.
- // You can use `chai` for assertions.
- const chai = require("chai");
- const assert = chai.assert;
- // Uncomment the following line to disable truncating failure messages for deep equals, do:
- // chai.config.truncateThreshold = 0;
- // Since Node 12, we no longer include assertions from our deprecated custom test framework by default.
- // Uncomment the following to use the old assertions:
- // const Test = require("@codewars/test-compat");
# test.assert_equals(actual, expected, [optional] message)@test.describe("Example")def test_group():@test.it("test case")def test_case():test.assert_equals(1 + 1, 2)- describe("Solution", function() {
- it("should test for something", function() {
- // Test.assertEquals(1 + 1, 2);
- // assert.strictEqual(1 + 1, 2);
- });
- });
// const reverseStr = str => [...str].reverse().join(''); <-- weak smh // function reverseStr(str){return str.split("").reverse().join("")} // console.log(reverseStr('hello world')); reverseStr = str => str.split("").reverse().join("")
- // const reverseStr = str => [...str].reverse().join(''); <-- weak smh
function reverseStr(str){return str.split("").reverse().join("")}- // function reverseStr(str){return str.split("").reverse().join("")}
console.log(reverseStr('hello world'));- // console.log(reverseStr('hello world'));
- reverseStr = str => str.split("").reverse().join("")