DEV Community

doYoda() => {...}

Alt Text

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) {
        name: "yoda",
        time: "NOW",
        text: [thereIsNoTry[doOr]]
      this.forceUpdate(() => {
        /* spaghetti && meatballs */
Enter fullscreen mode Exit fullscreen mode

Fun little script i use instead of lorem... maybe a fun npm module if someone wants to own it.


If you found this helpful or useful, please share a 💓, 🦄, or 🔖. Thanks!

Discussion (1)

miketalbot profile image
Mike Talbot

I am totally borrowing that haha