JS: iterating over result of getElementsByClassName using Array.forEach

No. As specified in DOM4, it’s an HTMLCollection (in modern browsers, at least. Older browsers returned a NodeList). In all modern browsers (pretty much anything other IE <= 8), you can call Array’s forEach method, passing it the list of elements (be it HTMLCollection or NodeList) as the this value: If you’re in the happy position of being able to use ES6 (i.e. you can safely … Read more

Merging two DataFrames

The error message indicates that df2 is of type pd.Series. You need to convert df2 .to_frame() as .merge() needs a pd.DataFrame() input (see docs): while you probably also just could: Alternatively, you can use pd.DataFrame.join() which accepts a pd.Series.

How to get unique values in an array

Since I went on about it in the comments for @Rocket’s answer, I may as well provide an example that uses no libraries. This requires two new prototype functions, contains and unique For more reliability, you can replace contains with MDN’s indexOf shim and check if each element’s indexOf is equal to -1: documentation

button vs. input type=”button” /. Which to use?

Here’s a page describing the differences (basically you can put html into a <button></button>) And another page describing why people avoid <button></button> (Hint: IE6) Another IE problem when using <button />: And while we’re talking about IE, it’s got a couple of bugs related to the width of buttons. It’ll mysteriously add extra padding when you’re trying to add styles, meaning … Read more