OOPS & Pattern in JS