snipt

Ctrl+h for KB shortcuts

JavaScript

Use layer name as index

i = thisLayer.name.substr(thisLayer.name.length - 1);
https://snipt.net/embed/5508844775c46c037e9f0cf8146a834b/
/raw/5508844775c46c037e9f0cf8146a834b/
5508844775c46c037e9f0cf8146a834b
js
JavaScript
3
2019-07-19T17:54:02
True
False
False
/api/public/snipt/147362/
use-layer-name-as-index
<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="nx">i</span> <span class="o">=</span> <span class="nx">thisLayer</span><span class="p">.</span><span class="nx">name</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">thisLayer</span><span class="p">.</span><span class="nx">name</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span> </span></pre></div> </td></tr></table>
ae, expressions