JSFiddle - React, Tailwind, and code Playground

by tjnicolaides

JavaScript

var itemExists = false; // let this be a test you write to see if your GET query returns the product you're looking for

if(itemExists) {
    console.log('now add it to the list with the existing aisle number');
} else {
    var newAisleNumber = prompt('would you like to add a new item? What aisle is it in?');
    
    console.log('now do a POST with the name of your new item and the aisle number value from the prompt: ' + newAisleNumber);
    
}