Skip to content

Instantly share code, notes, and snippets.

@jssteinberg
Last active February 1, 2022 08:52
Show Gist options
  • Save jssteinberg/3067dd21a2efe50e7859e3d03c6e313d to your computer and use it in GitHub Desktop.
Save jssteinberg/3067dd21a2efe50e7859e3d03c6e313d to your computer and use it in GitHub Desktop.
Seems more FP to freeze the object returned from a factory function, but what's the drawbacks (how slow is it)?
const newObj = ({param=`paramDefault`}) => Object.freeze({
param
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment