use  instead of just assigning the value
use Vue.util functions instead of implementing them myself