Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Talk:JavaScript/Lexical structure

Page contents not supported in other languages.
Add topic
From Wikibooks, open books for an open world
<Talk:JavaScript
Latest comment:3 years ago by Kelti in topicRewriting in 2022

Functions already? Really?

[edit source]

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 aboutteaching functions yet but only aboutsyntax.Jedihawk (discusscontribs)17:46, 15 December 2011 (UTC)Reply

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)Reply

Comments

[edit source]

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

--Mtmomx2 (discusscontribs)14:16, 24 August 2012 (UTC)Reply

Use of newlines

[edit source]

"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

[edit source]

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 (discusscontribs)10:08, 28 October 2022 (UTC)Reply

Retrieved from "https://en.wikibooks.org/w/index.php?title=Talk:JavaScript/Lexical_structure&oldid=4197839"

[8]ページ先頭

©2009-2025 Movatter.jp