0

I would like to check the coordinate x and y which is duplicated, then remove those existing objects and generate the new one in Canvas world objects. Could anyone kindly gimme a solution. A simple test jsfiddle would be appreciate. Thanks you in advance !

1 Answers1

0

You can use a map in javascript then add those co-ordinates in the map. If the co-ordinates are repeated, you can go for creating a new one.

Follow this question to implement a map in javascript.

Community
  • 1
  • 1
The Apache
  • 1,076
  • 11
  • 28
  • better to use [ES6 Map](http://www.2ality.com/2015/01/es6-maps-sets.html) collection instead of old school js hacks – Alex Filatov Nov 23 '15 at 09:31