Cbt nuggets cisco// a double loop that solves this problem O(n^2) VS. two.some(item => one.includes(two)) // this is more efficient than the double loop method // but behind the scenes isnt javascript just looping ? // why is this more performant ? // and is the big O of this O(n)? Toyota camry rough idle at dead stopIf you check the definition of the O() notation you will see that (multiplier) constants doesn't matter.. The work to be done within the loop is not 2. There are two statements, for each of them you have to do a couple of machine instructions, maybe it's 50, or 78, or whatever, but this is completely irrelevant for the asymptotic complexity calculations because they are all constants.