inherit method

as seen on typescript