Inspirational hypno-quotes generator battle limiting beliefs

  • The javascript was super easy but it’s still hard for me to know what I’m doing with Git :grimacing:
  • It took me like 30 minutes to write the javascript but then I had a problem pushing to github which took me over 1.5 hrs to figure out :grin:
  • The link to my code repo: Project GitHub Repo
1 Like

Nice job!

I feel like this bit can be potentially factored into something iterative:

let textIndex1 = Math.floor(Math.random()*this._part1.length);
let textIndex2 = Math.floor(Math.random()*this._part2.length);
let textIndex3 = Math.floor(Math.random()*this._part3.length);
1 Like

True, thanks for your input @toastedpitabread :grinning:

Do you know if that’ll change/improve Big-O notation time?

Cheers mate,
@tomaverick

This falls under DRY (don’t repeat yourself) – a saying I don’t like because I like to think positively with my reminders ahhaha (they end up being less catchy).

It’s O(n) whichever way because it’s linearly constant (one for-loop is O(n)). It’s just more code to write and less flexible if you need to use this pattern for something else.

1 Like

hahaah very true, well I appreciate you repeating yourself one more time. It should be defined DRY-to a machine… because some of us humans can use some reminders from time to time :laughing:

And your explanation makes perfect sense, much appreciated

Cheers mate