Browser crashes when run this, and I don't know the proper layout


#1

/*jshint multistr:true */
var text = " sjkfhgdojalzjkkfgahkasdhjgfkahjdkcyvikalachlanjfgjkkkfh\
asdfsdfhsjsvlaooisdlfalalaskdfaljsdfglallachlanasdfasdfadfhjghgj\
asdfasdfadsdflhkalggltllachlanfhjksdgfjhhjshhfhgkliluwoierutyybvb\
sdfkgkladkfllachlanasdfadslachlan"
var myName = "lachlan"
var hits = []

{for(i=0; i if(text[i] === "l"){
for(j=i; j = i+myName.length; j++){
hits.push(j)
}
}
};}

this is what I have

thanks


#2

10 minutes... Figured it out yet?


#3

@textcoder46385,
Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

= https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for