Coding task · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
Boolean Logic
Comparisons (>=, <, ===) give true or false. You combine conditions with && (and) and negate them with ! (not).
Task
You have the data: const fenceVoltage = 10000, const requiredVoltage = 8000, const visitorsInPark = 250 and const maxVisitors = 500. Create Boolean variables: isFenceSecure (the voltage is equal to the required one or higher), isParkFull (the number of visitors has reached the limit) and canAcceptVisitors (the fence is secure and at the same time the park is not full). Display all three in the console.