JavaScript Base Code(Inspired by @uppaa)