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 !
Asked
Active
Viewed 80 times
0
-
you should post a case, with a snippet or fiddle, of what you have and what you expect! – Hitmands Nov 23 '15 at 09:28
-
A simple "ask jsfiddle" would be more appreciated. :) – Kursad Gulseven Nov 23 '15 at 09:29
1 Answers
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