snipt

Ctrl+h for KB shortcuts

JavaScript

JS if shorthand

this.slide_direction = (this.options.content_type != 'comments_slider') ? 'left' : 'up';
https://snipt.net/embed/3c8f2379df8b39716fd27790653a7e2d/
/raw/3c8f2379df8b39716fd27790653a7e2d/
3c8f2379df8b39716fd27790653a7e2d
js
JavaScript
1
2019-07-11T16:22:59
True
False
False
/api/public/snipt/23218/
js-if-shorthand
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">this</span><span class="p">.</span><span class="nx">slide_direction</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">content_type</span> <span class="o">!=</span> <span class="s1">&#39;comments_slider&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;left&#39;</span> <span class="o">:</span> <span class="s1">&#39;up&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
js, shorthand

Text only

php shorthand IF

<?="var is ".($var < 0 ? "negative" : "positive"); ?>
https://snipt.net/embed/317991be3f455b7749d6be7d1c145318/
/raw/317991be3f455b7749d6be7d1c145318/
317991be3f455b7749d6be7d1c145318
text
Text only
2
2019-06-29T23:46:15
True
False
False
/api/public/snipt/1700/
php-shorthand-if
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?=&quot;var is &quot;.($var &lt; 0 ? &quot;negative&quot; : &quot;positive&quot;); ?&gt; </span></pre></div> </td></tr></table>
if, php, shorthand