Javascript Pattern Matching Examples