Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                Check the console.




 * Freeze a multi-dimensional array or object
 * (c) 2021 Chris Ferdinandi, MIT License,
 * @param  {Array|Object} obj The array or object to freeze
 * @return {Array|Object}     The frozen array or object
function freeze (obj) {

	// Get object type
	let type =, -1).toLowerCase();

	 * Check if the item is an array or object
	 * @param  {Array|Object}  item The item to check
	 * @return {Boolean}            If true, item is an array or object
	function isArrOrObj (item) {
		return ['array', 'object'].includes(, -1).toLowerCase());

	// If an object, recursively freeze
	if (type === 'object') {
		for (let key in obj) {
			if (obj.hasOwnProperty(key)) {
				if (isArrOrObj(obj[key])) {

	// If an array, recursively freeze
	if (type === 'array') {
		for (let item of obj) {
			if (isArrOrObj(item)) {

	// Freeze and return the object
	return Object.freeze(obj);


let wizard = freeze({
	name: 'Merlin',
	age: 'old AF',
	spells: ['Disappear', 'Levitate', 'Heal']

wizard.age = 42;
wizard.wand = true;
wizard.spells.push('Dancing brooms');