pairs using recursion

Run Settings
LanguageJavaScript
Language Version
Run Command
const a = ['A','B','C','D','E']; function split(a,p) { if(a.length==0) return; else { let a1 = a[0]; let b = a[1]; a.splice(0,2); p.push([a1,b]); console.log(a,p) split(a,p); return p; } } console.log(split(a,[]));
Editor Settings
Theme
Key bindings
Full width
Lines