query: Javascript: When I use the same code but outside of a function it works
positive_passages.docid: 124
positive_passages.text: Is JavaScript a pass-by-reference or pass-by-value language?
negative_passages.docid: 67874
negative_passages.text: var name produces strange result in Javascript
negative_passages.docid: 18716
negative_passages.text: Why are my JavaScript function names clashing?
negative_passages.docid: 38133
negative_passages.text: JavaScript variables declare outside or inside loop?
negative_passages.docid: 9122
negative_passages.text: Setting a function equal a variable?
negative_passages.docid: 102063
negative_passages.text: Global JavaScript Variable Scope: Why doesn't this work?
negative_passages.docid: 65510
negative_passages.text: Why does this function return a different value every time?
negative_passages.docid: 74142
negative_passages.text: Why isn't `method=` treated the same as any other method?
negative_passages.docid: 92485
negative_passages.text: JavaScript by reference vs. by value
negative_passages.docid: 63814
negative_passages.text: Why is this Java code in curly braces ({}) outside of a method?
negative_passages.docid: 59266
negative_passages.text: How does jQuery work when there are multiple elements with the same ID value?
negative_passages.docid: 45880
negative_passages.text: Custom function won't refresh as inputs are changed
negative_passages.docid: 122608
negative_passages.text: Does the syntax (whitespace) of a javascript function return affect the result?
negative_passages.docid: 144051
negative_passages.text: Code works in fiddle, but not on webpage
negative_passages.docid: 92055
negative_passages.text: In JavaScript, why is "0" equal to false, but when tested by 'if' it is not false by itself?
negative_passages.docid: 41373
negative_passages.text: Why does this work in jsfiddle but not in my document
negative_passages.docid: 140402
negative_passages.text: Do inner functions in JavaScript get hoisted? How do the scoping rules apply to them?