0

As is known TypeScript does not support multiple inheritance.

What is approach to use instead, definitely it can be composition. Also to apply builder pattern?

2
  • There is no multiple inheritance, hence there's no approach to do it. If you have a specific problem, post the specific problem along with code. Voting to close as too broad. Commented Jul 17, 2018 at 20:26
  • What approach would you use in JavaScript? I would imagine that question has the same answer. Commented Jul 17, 2018 at 20:27

1 Answer 1

1

Typescript is a superset of JavaScript. Its main purpose is to provide type savety as JavaScript itself doesn‘t care about this issue.

JavaScript is incomparable to C++, C# or Java when it comes to inheritance.

To sum it up: Yes, composition is the better way to go here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.