0

I know that this question has been already asked here.Sorry for that. But, I needed some further clarifications.

My question is if I type let hello='2'; in Ecmascript 6 on the very first line on the script then it will work fine. But, in typescript it will throw the error. If let is block scoped then why did it work on Ecmascript6 and why it did not in typescript.

nemo
  • 5
  • 5
  • 1
    What error are you seeing in typescript? I don't think there should be an issue. Also is there a specific question on the site that you want additional clarification on? If so it may help to link to it. – schu34 Oct 19 '19 at 15:22
  • @schu34 *cannot re declare block scoped variable.* this is the error. https://stackoverflow.com/questions/35758584/cannot-redeclare-block-scoped-variable-typescript and here is the link for the question already asked. – nemo Oct 19 '19 at 15:55
  • What are you doing with this file? – jperl Oct 19 '19 at 18:32
  • Possible duplicate of [cannot redeclare block scoped variable (typescript)](https://stackoverflow.com/questions/35758584/cannot-redeclare-block-scoped-variable-typescript) – Kamil Naja Oct 19 '19 at 18:40
  • What exactly is your code - *did* you declare a `hello` variable in multiple location? And what exactly is your question, for what part of the answer do you need further clarification? – Bergi Oct 19 '19 at 23:25

0 Answers0