4

I read on this ECMAScript page that 'class' is part of JavaScript. On this page about TypeScript, I see the 'class' is available in Typescript too.

My question is, the right approach to develop JavaScript applications FOR FUTURE is to take advantage of (a) the Object Oriented features in JavaScript and the features that will be availablein EMACScript 7.0 or (b) use libraries like TypeScript

4
  • Please define the "right" term. Commented Apr 19, 2015 at 22:57
  • What I meant by 'right' is to use language features rather than a framework feature so I can avoid the framework dependency. With that I don't have to worry about upgrading the framework when a new feature comes out. Commented Apr 19, 2015 at 23:02
  • If that works for you - use it. If it does not - do not. Commented Apr 19, 2015 at 23:03
  • class is a reserved keyword in JavaScript. But it's not used yet. ES6 has defined classes, but I suspect that browsers will take their time to implement them. Whether you should use native JavaScript, or use a dialect of JavaScript such as TypeScript is really personal preference. Commented Apr 19, 2015 at 23:05

1 Answer 1

8

My question is, the right approach to develop JavaScript applications FOR FUTURE is to take advantage of (a) the Object Oriented features in JavaScript and the features that will be availablein EMACScript 7.0 or (b) use libraries like TypeScript

Either is fine. Depends upon if you want type safety.

If not there is stuff like babeljs. https://babeljs.io/

If yes then use typescript http://www.typescriptlang.org/

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

3 Comments

Worth to mention that the current stable version of TS does not support most of ES2015 features. Apart of that +1
I assume from your answer that the type safety is not going to be supported in JavaScript in the future, so the using JavaScript Vs TypeScript is purely based on type safety.
It might be supported in ES7+. But there is no concrete work on that.

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.