Talk:JavaScript/Lexical structure

Functions already? Really?
The first few examples in this chapter use function definitions to demonstrate minimal, typical, and maximal use of whitespace. The reader hasn't seen the chapter on functions yet, so is this really a good idea?


 * I'm not too concerned about the functions example as it's not about teaching functions yet but only about syntax . Jedihawk (discuss • contribs) 17:46, 15 December 2011 (UTC)

I'm also uncertain how much of this is appropriate for a beginner in the first place... Shouldn't we be teaching the fun parts first and giving examples? --Jesdisciple (talk) 08:20, 11 May 2010 (UTC)

Comments
The previous chapter showed how to setup a comment and this this chapter changes the how. Which way should it be done?

--Mtmomx2 (discuss • contribs) 14:16, 24 August 2012 (UTC)

Use of newlines
"In JavaScript the use of semicolons is optional, as a new line indicates the end of the statement."

This may mislead readers to think that you can't split statements over multiple lines, while it should be encouraged when it improves readability. Actually adding any newline between tokens can never break working code nor change its interpretation, with just these exceptions:

EXPR [no newline here] ++ EXPR [no newline here] -- return|throw [no newline here] EXPR break|continue [no newline here] LABEL

Rewriting in 2022
This page and many others feel like a summary of the language specification. I believe that this is not the way how people learn a new language. A beginner needs a summary, short descriptions, and many excercises. Therefore I have added such elements into the page. Kelti (discuss • contribs) 10:08, 28 October 2022 (UTC)