JavaScript AJAX Basics (retiring) AJAX and APIs Make a JSONP request

use of const

Hello everyone,

I tried using const instead of var to create the variable but it says I should use var instead, is there any explanation regarding this??

weather.js
$(document).ready(function() {
    var weatherAPI;
});
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>What's the Weather Like?</title>
  <script src="jquery.js"></script>
  <script src="weather.js"></script>
</head>
<body>
  <div id="main">
    <h1>Current temperature: <span id="temperature"></span>&deg;</h1>
  </div>
</body>
</html>

1 Answer

Brendan Whiting
MOD
Brendan Whiting
Front End Web Development Treehouse Moderator 84,103 Points

I think it's just an old course before ES6 came out.

Also, the Fetch API is kind of the new version of AJAX.