Where am I going wrong in this code?
// Eyetee's Third Toy V0.0. Copyright 2012 by Eyetee and not released.
// Declare variables needed
var string_to_be_examined = "This is a test string that can also be obtained from \
some other location."
var substring_to_test_for
var i = 0
var j = 0
var storage_string = []
var location_found = []
// Obtain substring to test for
substring_to_test_for = prompt("Type in the text you wish to search for:")
// Test for presence of substring
for (i; i < string_to_be_examined.length; i++) {
if (string_to_be_examined[i] = substring_to_test_for[j]) {
storage_string.push(substring_to_test_for[j])
if (j < substring_to_test_for.length) {
j++
}
if (storage_string === string_to_test_for) {
location_found.push[j]
j = 0
}
}
};
if (location.found = "") {
alert("Your text wasn't found!")
}
else {
for (k = 0; k < location_found.length; k++) {
alert("Your text was found starting at the " + location_found.string[k] + "th character.")
}
}
Thanks to everyone for their help.