Let’s think about the function signature in different (statically typed) languages. Remember, the compile breaks out of the function when return method is called, and nothing after it is run. The function defines a return type, and to a naive programmer looking at the signature it seems that one can only return a single thing. And it’s true- you can only return one thing. But, that thing can be an Object or an Array.
“Often scripts will need to perform different tasks in different situation. You can use flowcharts to work out how the task fit together. The flowcharts show the paths between in step.”
Link to the original video:
This is the very first podcast in a long series of Angular podcasts. I’m just getting into them now myself, but I liked this first one a lot and wanted to share it in a blog post.
This has happened to me enough times before for me to be embarrassed by it, and for that reason I'm writing this blog post about it. If you have an if statement that is always returning true (it feels something like, "GAAAHH, why does my if statement always return true!) then this could be your problem (and solution!). I noticed this mistake again today working in Actionscript 3 while fixing a bug in Head Exploder. Here's a simplified version of the as3 code:
In the world today users will take for granted the ability to use the tab key on the keyboard to navigate between text fields in a form. In Flash you are building dialog boxes from shapes and TextFields so it can't guess how you want the tabs to be controlled. Luckily, you are given total control over this because text fields have the properties tabIndex and tabEnabled.
Tab index – This is an integer that basically allows you to put this text field in a list relative to all the other fields. The first one we should have a tabIndex of one, the second tabIndex of two, and so on. So suppose now you have the text field with tab index of one selected (which for TextFields just means that there is a cursor blinking inside of it). Then pressing tab will move your cursor to the TextField with index two. If you press tab again when the selection is on the text field the highest index then the list will loop back around, and the one that has index one will be selected.
The posts on this site are written and maintained by Jim Lynch. About Jim...