Move History

Fork Selected
  • Code
    export function takeFirstWord (text: string) {
      const split: string[] = text.split('').filter(char => char === char.toUpperCase());
      const join: string = split.join('');
      return join.replace(/\s/g, "")
    }
    
    takeFirstWord("I Love Typescript")
    Preloaded Code
    export function takeFirstWord () {
      // You Can Only Code Here
    }
    Test Cases
    // See https://www.chaijs.com for how to use Chai.
    import { assert } from "chai";
    
    import { takeFirstWord } from "./solution";
    
    // TODO Add your tests here
    describe("Testing_1", function() {
      it("Checking Code", function() {
        // assert.strictEqual(1 + 1, 2);
        assert.strictEqual(takeFirstWord("I Love Typescript"), "ILT")
      });
    });
    
  • Code
    • export function takeFirstWord (text: string) {
    • }
    • const split: string[] = text.split('').filter(char => char === char.toUpperCase());
    • const join: string = split.join('');
    • return join.replace(/\s/g, "")
    • }
    • takeFirstWord("I Love Typescript")