Pattern Matching In JavaScript

Simple pattern matching program In javascript