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??

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

1 Answer

Brendan Whiting
Brendan Whiting
Front End Web Development Techdegree Graduate 84,600 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.