0

Failed to compile I'm trying to run a currency converter app but i keep getting this when i try to fetch the response from an API

./src/Components/currencyconvert.js

  Line 25:22:  Parsing error: Unexpected token

  23 |              const currencyAr =  ["EUR"]
  24 |              for (const key in response.data.rates){
> 25 |                  currencyAr.push.(key);
     |                                  ^
  26 |               }
  27 |          this.setstate({currency: currencyAr });
  28 |          })      
1
  • 2
    you want to remove that dot so it should be currencyAr.push(key); as push is a function Commented Apr 15, 2020 at 12:57

1 Answer 1

1

Simple remove the dot.

currencyAr.push.(key);

should be

currencyAr.push(key);
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.