misc
- Describe one thing you’re learning in class today.
i learned about ternary operators (along with all the other operators and conditionals). so instead of writing
<code>if (x > y) {return “x > y”} else {return “x is not > y”}</code>
you can just write
<code>x > y ? return “x > y” : “x is not > y”</code>
2. What is the difference between == and === ?
== means that two values are equal comparatively, while === means that two values are equal comparatively as well as having the same data type.
3. What is the value of foo? var foo = 10 + '20';
“1020"
4. Describe what a terminal application is.
a terminal application is a user interface built into a terminal so that the user can interact with a set of programming instructions inside the terminal (which is already a type of terminal application, so an actual terminal application is an application built on top of the terminal itself, and operated on within the terminal, and can be exited from back into the default terminal). an example of this would be a credit card terminal that has commands for working with and storing a database of credit card transactions.
5. What is the ternary operator?
oh goody i already answered this question. here it is again for the sake of completion:
instead of writing:
<code>if (x > y) {return “x > y”} else {return “x is not > y”}</code>
you can just write
<code>x > y ? return “x > y” : “x is not > y”</code>
6. What are some ways to ensure that your website design or web application is accessible and user-friendly?
well following ARIA is a good start. placing alt tags on all photos so screen readers can inform blind users for example. also, using methods such as .trim() and .toLowerCase() can ensure that users can make small mistakes and your data still be “clean” without having to strongarm the user into typing exactly correct inputs.
7. What are your favorite features of HTML5, and how have you implemented them in your front-end development projects?
i won’t lie, i had no favorite features as i did not use pre-html5 html so here’s some cool ones i like after looking it up:
the contenteditable attribute. i think it’s cool to be able to make certain parts of my site possible to have the text changed by the user. also the placeholder attribute is pretty nifty, as i already have used it without ever knowing that prior to html5, it required javascript magic to implement.
8. How do you structure your CSS and JavaScript to make it easier for other developers to work with?
name your id’s, classes, tags, variables, and functions in a way that very specifically describes their purpose. use camelCase for javascript functions. use lowercase-and-dashes for css id’s and classes. use <main>, <article>, and <section> tags when appropriate instead of a mess of divs.
9. What’s your process for addressing browser-specific rendering problems? Do you find that a certain browser is more challenging to work with than others?
for one, use a css reset. also specify the !doctype. and you can use prefixes that call on the experimental versions of certain features that some browsers might not be fully compatible with yet, e.g.:
-webkit-transform: rotate(90deg);
background-image: -moz-linear-gradient(left,green,yellow);
background-image: -webkit-gradient(linear,left center,right center,from(green),to(yellow));
background-image: linear-gradient(to right,green,yellow);
where the -webkit- prefix is for chrome, the -moz- is for firefox (mozilla), and then the version with no prefix for browsers that are already compatible.