Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a javascript function called regCheck that can check if a registration number is for GP, L, EC, MP registration plates. It takes two parameters

Write a javascript function called regCheck that can check if a registration number is for GP, L, EC, MP registration plates. It takes two parameters and return a boolean. The function should return true for registration numbers like this:

RG 45 HN GP

LKG 679 EC

GHT 456 MP

FGT 491 L

The function should return false for registration numbers like this:

ND 123-456

CY 678-453

CA 1234-123

image text in transcribed

var isGP = regCheck('DV 23 NB GP', 'GP'); // should print true console. log( isGP); var isMP = regCheck('DV 23 LP GP', 'MP'); // should print false console. log( isMP); // should return false var isBellville = regCheck('CY 189-012', 'CY'); // should return false var isDurban = regCheck('CY 189-012', 'ND')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions