ES 6

ES 6 Vanilla JS

by Leolloyd Andrade

HTML

<textarea id="txt" name="txt" rows="10" cols="50">
  
</textarea>

JavaScript

const fn = (x, ...a) => x + a.length;
const v = fn(1, 'hello', 'world');

const txt = document.getElementById('txt');
txt.value = `Length of arguments: ${v}`;