- Economics & Finance
- Health & Medicine
- Step by Step
Want to read more? read more..
xii 3Getting functional introducing functions Get ready for your first superpower. You’ve got some programming under your belt; now it’s time to really move things along with functions. Functions give you the power to write code that can be applied to all sorts of different circumstances, code that can be reused over and over, code that is much more manageable, read more..
xiv 5A trip to Objectville undestanding objects So far you’ve been using primitives and arrays in your code. And, you’ve approached coding in quite a procedural manner using simple statements, conditionals and for/while loops with functions—that’s not exactly object- oriented. In fact, it’s not object-oriented at all! We did use a few objects here and there read more..
xv Did someone say “Objects”?! 174 Thinking about properties... 175 How to create an object 177 What is Object-Oriented Anyway? 180 How properties work 181 How does a variable hold an object? Inquiring minds want to know... 186 Comparing primitives and objects 187 Doing even more with objects... read more..
xvii 8Building an app bringing it all together Put on your toolbelt. That is, the toolbelt with all your new coding skills, your knowledge of the DOM, and even some HTML & CSS. We’re going to bring everything together in this chapter to create our first true web application. No more silly toy games with one battleship and a single row of hiding places. In this read more..
xviii 9 Handling events asynchronous coding After this chapter you’re going to realize you aren’t in Kansas anymore. Up until now, you’ve been writing code that typically executes from top to bottom—sure, your code might be a little more complex than that, and make use of a few functions, objects and methods, but at some point the code just runs its course. read more..
xx 11 Serious functions anonymous functions, scopes, and closures You’ve put functions through their paces, but there’s more to learn. In this chapter we take it further; we get hard-core. We’re going to show you how to really handle functions. This won’t be a super long chapter, but it will be intense, and at the end you’re going to be more expressive read more..
xxi 12 Creating objects advanced object construction So far we’ve been crafting objects by hand. For each object, we’ve used an object literal to specify each and every property. That’s okay on a small scale, but for serious code we need something better. That’s where object constructors come in. With constructors we can create objects much more easily, and we read more..
xxii 13 Extra strength objects using prototypes Learning how to create objects was just the beginning. It’s time to put some muscle on our objects. We need more ways to create relationships between objects and to share code among them. And, we need ways to extend and enhance existing objects. In other words, we need more tools. In this chapter, you’re going read more..
xxiii 14 The top ten topics (we didn’t cover) Appendix: Leftovers We’ve covered a lot of ground, and you’re almost finished with this book. We’ll miss you, but before we let you go, we wouldn’t feel right about sending you out into the world without a little more preparation. We can’t possibly fit everything you’ll need to know into this relatively small read more..
16 Chapter 1 expressions exercise (9 / 5) * temp + 32 color == "orange" name + ", " + "you've won!" yourLevel > 5 (level * points) + bonus color != "orange" 1000 + "108" What is the result when temp is 10? __________ Is this expression true or false when color has the value “pink”? __________ Or has the value read more..
32 Chapter 1 how to add code to your page You can place your code inline, in the <head> element. The most common way to add code to your pages is to put a <script> element in the <head>. Sure, it makes your code easy to find and seems to be a logical place for your code, but it’s not always the best place. Why? Read on … How read more..
40 Chapter 1 exercise solutions (9 / 5) * temp + 32 color == "orange" name + ", " + "you've won!" yourLevel > 5 (level * points) + bonus color != "orange" 1000 + "108" What is the result when temp is 10? __________ Is this expression true or false when color has the value “pink”? __________ Or, has the value read more..
actionURI(http://www.oreilly.com):oreilly.com Spreading the knowledge of innovators Want to read more? You caactionURI(http://shop.oreilly.com/product/0636920027065.do):n actionURI(http://shop.oreilly.com/product/0636920027065.do): buy actionURI(http://shop.oreilly.com/product/0636920027065.do): this actionURI(http://shop.oreilly.com/product/0636920027065.do): book at oreilly.com in print and ebook format. Buy 2 read more..
Write Your Review