Added euclidean distance in Javascript