Try out the P42 refactorings in the browser, without installing anything. You can copy & paste your own code.
Convert variable declarations with multiple variables into separate declarations that declare one variable each.
The == null check is a concise expression to identify nullish values (null and undefined).
Arrow functions are a concise syntax that can often replace the regular function syntax.
Default parameters allow providing default values for function parameters.
for...of loops over iterable objects, for example arrays or strings.
let and const are block-scope variable declarations that can replace 'var' declarations in many cases.
The nullish coalescing operator (??) returns its right side when its left side is nullish (null or undefined), and its left side otherwise.
The optional chaining operator returns the value of an object property when the object is available and undefined otherwise.
The spread syntax (...) allows iterables like array expressions to be expanded in place where arguments are expected.
Template literals are string templates that can include variables and expressions.