NodeJS buffer.slice() is not a function?
<p>I am trying to use slice() to remove some unwanted elements from the buffer. Code goes like this:</p>

<pre><code>function unpack (item) { // item is a buffer
    var ivlength = 16;
    if(algorithm == 'aes-128-ecb') ivlength = 0;
    var ciphertext = item.slice(ivlength, item.length);
    return ciphertext;
}
</code></pre>

<p>The console says: item.slice() is not a function. The NodeJS documentation says otherwise: <a href="https://nodejs.org/api/buffer.html#buffer_buf_slice_start_end" rel="nofollow">buf.slice() documentation</a>.</p>

<p>I have updated NodeJS to 5.9.1 version with no improvements.</p>