File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 88String . prototype . cliche = function ( ) {
99 var cliche = [ "lock and load" , "touch base" , "open the kimono" ] ;
1010
11- for ( var i = 0 ; i < cliche . length ; i ++ ) {
12- var index = this . indexOf ( cliche [ i ] ) ;
13- if ( index >= 0 ) {
14- return true ;
15- }
16- }
17- return false ;
11+ return cliche . some ( phrase => this . includes ( phrase ) ) ;
1812} ;
1913
2014var sentences = [ "I'll send my car around to pick you up." ,
21- "Let's touch base in the morning and see where we are" ,
15+ "Let's touch base in the morning and see where we are" ,
2216 "We don't want to open the kimono, we just want to inform them." ] ;
2317
24- for ( var i = 0 ; i < sentences . length ; i ++ ) {
25- var phrase = sentences [ i ] ;
26- if ( phrase . cliche ( ) ) {
27- console . log ( "CLICHE ALERT: " + phrase ) ;
18+ sentences . forEach ( sentence => {
19+ if ( sentence . cliche ( ) ) {
20+ console . log ( `CLICHE ALERT: ${ sentence } ` ) ;
2821 }
29- }
30-
31-
22+ } ) ;
3223</ script >
3324</ head >
3425< body >
You can’t perform that action at this time.
0 commit comments