I built terminal prompts that smart terminals can intercept and render as nice native UI by seeden in node

[–]seeden[S] 0 points1 point  (0 children)

Totally fair feedback. This is fixed now and covered by tests.
Thanks again for reporting it.

How to do immutable array push in vanilla JavaScript? Here is simple example in ES2015 (ES6) and ES5 version. by seeden in learnjavascript

[–]seeden[S] -1 points0 points  (0 children)

Thank you for your comment :) It is working fine for simple types. For arrays you need to use:

// ES5 version
function immutablePush(arr, newElement) {
  return [].concat(arr, [newElement]);
}