2
devNaut
7y

Commons sense/ best practice:

Is It ok ti initialize (angular) variabile as {id:" ", name:" ", ..} to avoid errors in the browser console such as "can't get ID of undefined"?

My concern is code readability and debugging, is not ok for the ones looking at the browser console to have such useless errors, on the other side you have to initialize some variables with object that have a lot of keys(id name ecc...) Whith empty fields...useless.

The apps work both cases, whit or whitouth initialization.
By the way we are getting such data by api calls later on.

Comments
Add Comment