Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Validating user input
node v14.20.1
version:
1.0.0
endpoint
share
tweet
const validZipCodes = [90210, 12345, 11111]; function isZipCodeValid(zipCode) { return validZipCodes.includes(zipCode); } console.log(isZipCodeValid(90210)); // Output: true console.log(isZipCodeValid(22222)); // Output: false
Loading…
no comments
sign in
to comment