Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.


Auto Save

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.


<ul class="outlet"></ul>



body {
	padding: 30px;




const apes = ['Orangutans', 'Gorilla', 'Chimpanzees', 'Humans'];

// classic foreach method with anonymous function
apes.forEach( function(ape) {
  return console.log('1', ape);

// a regular function
function printApe(ape) {
  return console.log('2', ape);

// array.forEach method with named function passed in
apes.forEach( printApe ); // does this feel mysterious?

// an "arrow" function as an "anonymous" callback function 
apes.forEach( (ape) => console.log('3', ape) );
// implicit return
// (starting to be the default in MDN documentation)

// you can leave out the (arg) if there's only one
apes.forEach( ape => printApe(ape) );

// if there is no argument you need empty parenthesis
apes.forEach( () => console.log('4') );

// if you open up a codeblock, you need to explicitly return again
apes.forEach( (ape)=> {
  return console.log('5', ape);

// What ^ is happening here exactly?
apes.forEach( function(ape) {
  return console.log('6', ape);
// what is different about the syntax?