js logics