test js logic