Please help with the challenge

Here I want to create an app using the code from ( Functional Programming: Understand Functional Programming Terminology)
here are my html and js code

<input id="numOfCups" type="number" />
<button onclick="prepareTea()" id="black" value="Black Tea">Black</button>
<button onclick="prepareTea()" id="green" value="Green Tea">Green</button>

<p id="readyTea"></p>


let prepareTea = (teaColor, numCups) => {
    let greenT = document.querySelector('#green').value;
    let blackT = document.querySelector('#black').value;
    let numCup = document.querySelector('#numOfCups').value;
    let readyT = document.querySelector('#readyTea');

    let teaCups = [];

    for (let cup = 1; cup <= numCups; cup++) {
        const teaCup = teaColor();
    readyT.textContent = teaCups;

also html buttons I used this code

<button onclick="prepareTea(black,numOfCups)" id="black" value="Black Tea">Black</button>
<button onclick="prepareTea(green,numOfCups)" id="green" value="Green Tea">Green</button>

what is wrong I am looking forward to here you guys…

What error are you getting?


I’ve got it fixed

1 Like

Hi guys
I have done the Functional Programming, Understand Functional Programming Terminology on codepen but there is a problem to be fixed. The problem is with the ‘if statement’, it should control the program if input is empty or number for teacups is not chosen it should pass the message to p element.

Done it