Coding books give silly examples, like dogs with properties like "breed" and methods like "bark." Can you give me a practical example that includes properties and at least one method—an example that someone would actually use on a real website?
posted by markcmyers
on Mar 18, 2013 -
5 answers
JavaScript question: Here in the U.S. myDate.toLocaleDateString () returns Thursday, Oct. 04, 2012. Can anyone give me an example of the date formatted for another locale?
posted by markcmyers
on Oct 4, 2012 -
2 answers
JavaScript question: What is the lowest number and what is the highest number generated by Math.random()?— 0.0000000000000000 or 0.0000000000000001, 1.0000000000000000 or 0.9999999999999999
posted by markcmyers
on Sep 25, 2012 -
3 answers
In JavaScript, I can't think of any situation in which nested if statements can't be replaced by more concise code that employs the logical operators &&, || and !. Can you think of any?
posted by markcmyers
on Aug 11, 2012 -
10 answers
In JavaScript, if I define a variable within in a conditional block, is the variable defined through a type of hoisting even if the condition isn't met?
[more inside]
posted by markcmyers
on Aug 2, 2012 -
5 answers
Do serious JavaScript coders use string-formatting methods like big()?
posted by markcmyers
on Apr 4, 2012 -
5 answers
I have a hard time remembering operator precedence rules in JavaScript. Is there anything wrong with using parentheses to force the precedence I want so I don't have to remember the rules?
posted by markcmyers
on Feb 20, 2012 -
12 answers
Literal notation vs. constructor: Which one should I use to create an object in JavaScript?
posted by markcmyers
on Feb 7, 2012 -
5 answers
I keep making the same JavaScript mistake, writing = when the rules call for ==. It's because both signs mean "equal," but in different contexts. Any tips for reprogramming myself so I get it right every time?
posted by markcmyers
on Jan 30, 2012 -
29 answers