Question: 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

Write a javascript function called regCheck that can check if a registration

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!