Question: :0 what's a function declaration? great, thank you

Asked By
wagonofjustice
Asked At
2017-10-10 16:11:45

Found 15 possible answers.

User Answered At Possible Answer
loganfsmyth 2017-10-10 16:12:14 node.id = t.identifier("cheese")
wagonofjustice 2017-10-10 16:12:24 var thing = function ?
loganfsmyth 2017-10-10 16:12:40 a declaration is specifically a function that is in a statement position in our code rather than an expression position
wagonofjustice 2017-10-10 16:13:01 icic hmmm
loganfsmyth 2017-10-10 16:13:10 so
function cheese(){}
is an expression
is a declaration, but 
var cheese = function cheese(){}
wagonofjustice 2017-10-10 16:13:22 ok, super if I have a function expression/declaration and I want to insert a call expression inside it, what's the best way to go about that?
loganfsmyth 2017-10-10 18:21:47 @wagonofjustice you'd add a new item to the .body.body array
drewml 2017-10-10 19:31:09 huh, apparently a new JSX spec change - https://github.com/facebook/jsx/pull/93
hzoo 2017-10-10 19:31:29 yea
drewml 2017-10-10 19:31:35 (ah, just noticed Logan was already looking at it)
hzoo 2017-10-10 19:31:45 some of us got pinged
drewml 2017-10-10 19:33:15 is this just to avoid using [] for adjacent nodes without a parent jsxelement?
loganfsmyth 2017-10-10 19:38:50 I think mostly
drewml 2017-10-10 19:39:43 gross :joy:
kovensky 2017-10-11 02:40:42 made a TS issue about it https://github.com/Microsoft/TypeScript/issues/19094 but I’m not sure I like the change either :thinking_face:

Related Questions