Adding breakpoint on existingFloor = app.root.findByName("Floor"); line and checking what value existingFloor will have after that line executed will give you a hint.
You assign value to variable, means you are redefining it.
Don’t forget to complete whole course on CodeAcademy on JS: https://www.codecademy.com/learn/learn-javascript As you are making simple JavaScript related mistakes that is basic to the language it self, not related to PlayCanvas.