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. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.