comparisons - "Behaves similar to" or "behaves similarly to"?


I wrote the following comment in a programming forum:



Objects in JavaScript behave similar to a regular associative array.



This is how I would use the word "similar" in normal conversation. However, the dictionary says that "similar" is an adjective, and "similarly" should be used in this context instead:



Objects in JavaScript behave similarly to a regular associative array.



Both constructions look grammatically correct to me, but the second one sounds weird. Searching the internet, I see both "behaves similar to" and "behaves similarly to" are used.


So are both considered grammatically correct?



Answer



In casual speech you can probably get away with similar, but you may sound uneducated to some. Similarly is the correct adverb form, and it does not sound weird. I would always write similarly in this case. The same is true for different and differently.




As a side note, this sentence lacks subject-verb agreement:


Objects in JavaScript behaves similarly to a regular associate array.


It should be:


Objects in JavaScript behave similarly to regular associate arrays.


(Also, the correct term is associative array)


Comments

Popular posts from this blog

commas - Does this sentence have too many subjunctives?

verbs - "Baby is creeping" vs. "baby is crawling" in AmE

time - English notation for hour, minutes and seconds

etymology - Origin of "s--t eating grin"

grammatical number - Use of lone apostrophe for plural?

etymology - Where does the phrase "doctored" originate?

single word requests - What do you call hypothetical inhabitants living on the Moon?