... People who are using the expression form are more likely to know what they are doing....
3013
Tom Worster
thefsb
Sep 20, 2012 12:34 am
... (i'm an incompetent but) i see it as analogous to the difference between: f = and var f = i the latter, function f is clearly within the scope of the...
3014
Emmett Pickerel
emmett.thesane
Sep 20, 2012 2:52 am
The function statement is evaluated at the top of the current scope, regardless of physical location. The function expression is evaluated at the same time as...
3015
Felix E. Klee
feklee
Sep 20, 2012 8:00 am
On Thu, Sep 20, 2012 at 4:52 AM, Emmett Pickerel ... I am aware of that. However, that's not what the error message is about. ... Like what?...
3016
Doc Emmett Splendid
emmett.thesane
Sep 20, 2012 10:05 pm
Sorry, that was a typo. I meant to say "there are other things you cannot do with the function *statement*". As for the error, to elaborate on what Douglas...
3017
Martin Cooper
mfncooper
Sep 21, 2012 3:34 am
On Mr Crockford's Remedial JavaScript page: http://javascript.crockford.com/remedial.html near the bottom, there is a little function called 'supplant39; that ...
3018
Felix E. Klee
feklee
Sep 21, 2012 8:24 am
On Fri, Sep 21, 2012 at 4:33 AM, Martin Cooper <mfncooper@...> ... Escaping `{` and `}` (`\{`, `\}`) doesn't do the trick?...
3019
Felix E. Klee
feklee
Sep 21, 2012 8:34 am
On Fri, Sep 21, 2012 at 12:05 AM, Doc Emmett Splendid ... To my knowledge, `function f` is just a shortcut for `var f = function`. I am unaware of any...
3020
John Hawkinson
john.hawkinson
Sep 21, 2012 8:40 am
... The former is hoisted. --jhawk@... John Hawkinson...
3021
Felix E. Klee
feklee
Sep 21, 2012 8:50 am
On Fri, Sep 21, 2012 at 10:33 AM, Felix E. Klee <felix.klee@...> ... Aside from the difference you mentioned earlier, of course: "The function statement is...
3022
Alexandre Morgaut
morgaut_a
Sep 21, 2012 10:44 am
... I see 2 differences first, the hoisting one which is even more important in a conditional block // this code won't work as it might be expected if (a ===...
3023
douglascrockford
douglascrock...
Sep 21, 2012 1:38 pm
... Thanks. I corrected that. My view on good JS style continues to evolve as I learn more about the language, thanks primarily to all of you who provide a...
3024
douglascrockford
douglascrock...
Sep 21, 2012 1:48 pm
... There were famous websites that were depending on having functions with -this- bound to the global object, who then put 'use strict' on the code. That code...
3025
benxwhite
Sep 21, 2012 6:59 pm
I can understand how . and [^...] might be dangerous in a "match" regular expression, but in a replace I cannot see the harm in them. My typical example would...
3026
douglascrockford
douglascrock...
Sep 21, 2012 8:00 pm
... Be consistently disciplined. That would be even nicer....
3027
benxwhite
Sep 25, 2012 2:59 pm
... Funny, your JSLint code seems to do the exact thing I'm suggesting is not a problem. ...
3028
douglascrockford
douglascrock...
Sep 25, 2012 4:31 pm
... What do you mean by funny? I don't see that statement in JSLint. JSLint does contain: /*jslint evil: true, nomen: true, regexp: true, todo: true */ return...
3029
Joe Hansche
joeatrr
Sep 26, 2012 8:44 am
I'm curious because I want to learn: You're saying that regexp "." and regexp "[^ ]" match inconsistently in different browsers, or is there a different...
3030
Felix E. Klee
feklee
Sep 26, 2012 9:26 am
... Where "they" refers to: [^...] ....
3031
Joe Hansche
joeatrr
Sep 26, 2012 4:16 pm
... Thanks. Though, I thought Douglas pushes for "competent" scripts, and people who "know what they're doing"? I, for one, understand what '.' and '[^...]39; ...
3032
Felix E. Klee
feklee
Sep 26, 2012 4:22 pm
... You could apply that to any of the rules that JSLint enforces: If you use X, then you should know what it will Y....
3033
Joe Hansche
joeatrr
Sep 26, 2012 4:36 pm
... I agree :) Yet, JSLint specifically makes that assumption regarding allowing "this" in a function expression. ... [Non-text portions of this message have...
... I agree with this. I really don't disagree with Crawford, or JSLint... but on SOME things I do. I use it a lot, because you're right: it does find bugs...
3037
bartman1c
Oct 2, 2012 10:52 pm
... Is not weird anymore, thank you....
3038
octavpo
Oct 3, 2012 10:04 pm
I have a statement in one of my functions: return serverInstanceId = response; JSLint flags it as: Expected ';' and instead saw '='. Unreachable '=' after...
3039
douglascrockford
douglascrock...
Oct 3, 2012 10:07 pm
... I recommend that you follow JSLint's advice and fix the code that you would agree is bad....