(for CSE 90025 FUTURES HTML5 and JavaScript)
10 sessions
hours.
Do no harm. And other advice.
Practice Iterative Design.
Respect others. Do not distract. Do not belittle. Special care will be taken for women and minorities as they are regularly disrespected. Racism or sexism in any form will NOT be tolerated in this class!
GitHub account setup post your first code (from the first excercise) and raise an issue on the class repo introducing yourself.
DevTools Console is a sort of IDE built into every copy of Chrome
Troubleshooting and Common errors and Cuiosities in Javascript
'cat' && 'dog' what does that return? Why? How might that be useful?
'cat' || 'dog' what does that return? Why? How might that be useful?
hints: && is logical AND which needs to know that both values are true. || is logical OR and doesn't need to know the second value if the first is true. 'cat' and 'dog' both evaluate to true.
var attrib = obj && obj.subobject && obj.subobject.attribute
|| 'default'
or if attribute is just one level down, use:
var attrib = obj ? obj.attribute : 'default'
var thing = getThing(parameter) || reporterror(message)
Keeps the focus on the expected action but still handles occasional errors.
e.g.
var contents = fs.open('filename') || process.exit(1) (actually only
useful in node)
See also:
file: /Techref/language/java/SCRIPT/tutorial.htm, 4KB, , updated: 2021/10/2 19:47, local time: 2024/8/14 12:59,
3.133.115.92:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/techref/language/java/SCRIPT/tutorial.htm"> JavaScript Tutorial</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.