simple codes in javascript