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.


                <h1>Happy Fibonacci day!</h1>
  Maybe I'm a day late. Sorry. Here's a way to calculate the Fibonacci Sequence using vanilla JavaScript without recursion. It gets a lot simpler <i>with recursion</i>, though. <br>
  In mathematics, the Fibonacci sequence is characterized by every number after the first two being the sum of the two preceding numbers:<br/>
    1, 1, 2, 3, 5, 8, 13, 21, 34, ...
  Often, especially in modern usage, the sequence is preceded by a zero:<br/>
    0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
  November 23 (11/23) is Fibonacci day because when the date is written in the MM/DD format, the digits are the start of the sequence: 1,1,2,3
<p id='result'></p>


                body {
  padding: .5em 1em;
#result {
  font-family: monospace;
  font-size: 1em;
  padding: .3em;
  background: black;
  color: green;


                var output = Array();
while (output.length < 1000) {
  var push;
  if (output.length <= 1) {
    push = output.length;
  } else {
    push = output[output.length - 1] + output[output.length - 2];
var result = document.getElementById('result');
output.forEach(el => {
  result.append(", ");