Changed lock in Javascript

Changed, so the consistency is better.