1d
revised I am trying to get a data from a list of objects
added 5 characters in body
1d
comment startsWith not returning expected value
Seems to work fine for me jsfiddle.net/hmzpsxtw
May
19
comment global variable undefined after setting it
It doens't work because it should be an else if. When a is 1, the first if changes it to 2 but the 2nd if then executes setting it back to 1.
May
19
comment global variable undefined after setting it
The important concept here is "variable hoisting". Even though the var a is lower in the function, the declaration of the local a is hoisted causing the alert to alert the local (yet to be defined) and not the global. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…
May
19
comment global variable undefined after setting it
Are you sure it's a global variable? If this code is within any sort of function (onload?) then the variable is not global due to the var before it. Not to mention that you aren't changing the global (if it is global) because you are again using var to declare a new local.
May
19
comment Find previous element of same type regardless of parent
Certainly a good idea if the elements are not dynamic.
May
19
answered Find previous element of same type regardless of parent
May
15
answered What's wrong with this indexOf implementation?
May
15
comment Is it correct to invoke the constructor of a JavaScript Object in one of the prototype functions?
@Oriol Then why put it on the prototype? This probably isn't a great question for SO, but this would certainly raise some questions in a code review.
May
13
comment Delay lineTo in for loop
@Teun I'm surprised they fall noticeably out of sync. You might consider calling the next drawLine in the callback to animate instead to force them to sync.
May
12
revised float attribute on wrapper turns nested div offsetWidth to 0
deleted 1 character in body
May
12
awarded Enlightened
May
12
awarded Nice Answer
May
11
comment Decrease the probability of getting random item from array same as previous one
Your posted code would have no effect. You have three independent calls to Math.random() the outcome of the first having no effect on the others.
May
6
answered Delay lineTo in for loop
May
6
comment Why is there an exclamation point in CSS's !important rule?
Putting "DIscussion" in the title is going to immediately get you downvotes as the site is meant for question and answer and not discussion.
May
6
revised Mouse cursor doesn't match with canvas
added 4 characters in body
May
6
revised How to use ALT tag correctly?
added 8 characters in body
May
5
comment Getting functions content with regex
Why are you trying to do this? Perhaps there's a better way to achieve your end goal?
May
5
comment css rtl after ltr not working on chrome
Perhaps you can explain further then? Adding text-align makes them nearly identical in FF and chrome: jsfiddle.net/wy2f2a74/3
1 2 3 4 5