Type Safety in Javascript