При вызове функции выдает ошибку: параметр, переданный в функцию, не определен - PullRequest
0 голосов
/ 20 сентября 2019

Мне нужна ваша помощь в написании сценария, связанного с API.Ниже приведен скрипт.

Вот документация для этого API https://github(dot)com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#general-api-information

<script>
  function getBinancedata(symbol){

    fetch (`http://cors-anywhere.herokuapp.com/https://api.binance.com/api/v1/trades?symbol=${symbol}`)
  .then(result=>{
    return result.json();
  })
  .then(data =>{
    const binan = data[0];
    console.log(`Price of ETH in USDT is ${binan.price} and Quantity of ETH sold ${binan.qty}`);
  })
  .catch(error=>alert(error));

  }
  getBinancedata(ETHUSDT);
    </script>

Я получаю эту ошибку

Uncaught ReferenceError: ETHUSDT is not defined

Заранее спасибо!

...