开发者

If I want to learn javascript by small project, what should I do? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 3 years ago.

Improve this question

I found javascript is not so easy to master. And I want to dive into it. I think learning by using is a good way. Since javascript i开发者_开发问答s different from other C-style language, what kind of project is good for learning?

Thanks.


You can take up any project that involves an interactive UI, then build it as a web page.
It will give you a lot to learn about js, from syntax to event handling.

E.g: a calculator


Since it's inevitable that people will suggest learning resources (whereas the question is about projects, here's a CW answer for people to use to list those resources.

Books

  • JavaScript: The Definitive Guide (5th ed.) by David Flanagan. Good book from a good author. Getting a bit dated.

Online Resources

  • The Specification (brand new 5th edition spec is out!). The language is turgid, but when you want to know exactly how something is supposed to work...
  • http://javascript.crockford.com/ Douglas Crockford is immensely knowledgeable about JavaScript. Not everyone (myself included — T.J.) agrees with all of Crockford's conclusions, especially around things like the new operator, but he does know his stuff and so if you take his various essays as observations to think about, not gospel, he's very educational and thought-provoking.
  • Mozilla Developer Center


The first project I'd do is get JsUnit working and figure out how I'm going to run the tests I write for the rest of the project on a regular basis (as in, simulated or real continuous integration).


Since you didn't post your age:
Playing around with Canvas might be a good start. The way I learned AS2 [which has similar functions and ECMAScript-style syntax, like JavaScript] was by creating a "Canvas"(MovieClip) and playing around with lineTo and moveTo.

With that, you could write simple games like Pong [my first AS2 game] with a simple AI...

Embarking on this project would cover:

  1. User Input
  2. Graphics
  3. Variables
  4. Flow Control
  5. setTimeout
  6. Logic
  7. Collision detection

Pong is a great first project, because you can customize it all that you want. When I wrote my version, I made it so by holding Enter, you could place a block in the middle of the screen, that the ball would bounce off of. The possibilities are basically endless =/


If you're interested in more "classic" web development [non-RIA things]
You could go for a simple lights-out game, which would take around 30 minutes to write.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜