Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ba787aa + d303c6c commit 75b2d11Copy full SHA for 75b2d11
general-patterns/conditionals.html
@@ -6,6 +6,12 @@
6
</head>
7
<body>
8
<script>
9
+// NOTE: Paul Irish states that the first statement is only an antipattern when optimizing for
10
+// low-bandwidth source (such as for a bookmarklet.
11
+// Using the first statement will generally outperform the regex in a loop, and is faster than the
12
+// object literal for lower numbers of conditions (they generally even out around 10 conditions).
13
+// See http://jsperf.com/if-this-or-that
14
+
15
// antipattern
16
if (type === 'foo' || type === 'bar' ) {}
17
0 commit comments