INSERT GRAPHIC HERE (include hyperlink in image)
Subtitle or Short Description Goes Here
ideally one sentence >
Faults in computer problems were theorized as far back as 1843, when Ada Lovelace noted of Babbage's Analytical Engine, "Granted that the actual mechanism is unerring in its processes, the cards may give it wrong orders." Almost 160 years later, NIST reported that software errors cost the US $59 billion annually. Clearly, some of the cards are wrong. However, unlike Grace Hopper's famous moth, most of the time the culprit is ourselves.
Debugging is a sanitization procedure consisting of:
Write a function, indexOf
, which takes in two strings--the needle and the haystack--and returns the index of the first appearance of the needle in the haystack. If the needle does not appear in the haystack, return -1
. Don't use indexOf()
, includes()
or substring()
,
indexOf('or', 'hello world'); // should return 7
indexOf('hello world', 'or'); // should return -1
indexOf('howdy', 'hello world'); // should return -1