Skip to content

Instantly share code, notes, and snippets.

View quassy's full-sized avatar
#MoarCoffeePlz

quassy

#MoarCoffeePlz
View GitHub Profile
@quassy
quassy / push-to-array.js
Last active February 10, 2016 23:43
Help you understand this?
text = "Kanye says: This string has the name Kenny embeded in it\n the following function should find it.";
var myName = "Kenny"; //String to find
var hits = []; // Empty array to put it into
var altHits = []; // Empty list for alternative hits
// Look for "K" in the text
/*
Loop over numbers from `0` to `text.length`
so you can access the single characters of `text`