If you're new to JavaScript and web programming, Learn JavaScript and W3 Schools JavaScript Tutorials are great places to start tinkering with code. For additional reading, Dive Into HTML5 and Eloquent JavaScript are two excellent, free resources. If you prefer videos, Crockford on JavaScript is an excellent resource.
If you already have some JavaScript experience, we recommend you start with our tutorial showing how to use ArcGIS.com templates to create apps. If you want to start with the API directly, take a look at how to create a simple app. You can also get started by browsing the ArcGIS API for JavaScript samples or the API Reference. For specific ArcGIS API for JavaScript questions, visit the ArcGIS API for JavaScript place on GeoNet.