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>

JS

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();
        teaCups.push(teaCup);
    }
    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?

2 Likes

I’ve got it fixed
thanks

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
thanks