12

Coming from Java background and taking toddler steps in Angular 2 with TypeScript, gives scope for so many comparisons. We can declare variables with types name : string inside a class in Angular 2 / TypeScript. How do i declare multiple variables of same type in single shot ? Is there a way to declare like name, designation, email : string in single line ?

0

1 Answer 1

5

There is no syntax that would work as just writing the type for each variable individually.

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

1 Comment

Tried couple of options but failed. Declaring each variable in separate line is such a pain !

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.