How would I write the equivalent of C#\'s String.StartsWith in JavaScript?
var haystack = \'hello world\'; var needle = \'he\'; haystack.startsWith(needle)
data.substring(0, input.length) === input