Рубрики
Без рубрики

doyoda () => {…}

doyoda () {let Door = (10 * math.random ()). Tofixed (0), Donot = (10 * Math.random ()) % 2 … с меткой JavaScript, Yoda, Fun, Strings.

doYoda() {
    let doOr = (10 * Math.random()).toFixed(0),
      doNot = (10 * Math.random()) % 2 > 1,
      thereIsNoTry = [
        "Do or do not. There is no try.",
        "You must unlearn what you have learned.",
        "Named must be your fear before banish it you can.",
        "Fear is the path to the dark side.",
        "That is why you fail.",
        "The greatest teacher, failure is.",
        "Pass on what you have learned.",
        "Now I know there is something strong than fear — far stronger.",
        "Don't underestimate the Force.",
        "For my ally is the Force, and a powerful ally it is."
      ];

    if(doNot) {
      this.strings.push({
        name: "yoda",
        time: "NOW",
        text: [thereIsNoTry[doOr]]
      });
      this.forceUpdate(() => {
        /* spaghetti && meatballs */
      });
    }
  }

Веселый маленький сценарий, который я использую вместо Lorem … может быть, веселый модуль NPM, если кто -то хочет владеть им.

🙂

Если вы нашли это полезным или полезным, пожалуйста, поделитесь 💓, 🦄 или 🔖. Спасибо!

Оригинал: “https://dev.to/zoedreams/doyoda-1gh3”