Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div>
  <button id='concat'>concat</button>
  <button id='spread'>スプレッド構文</button>
  <ul id='logContainer'></ul>
</div>

              
            
!

CSS

              
                button {
    border: 0;
    cursor: pointer;
    margin: 0;
    display: inline-flex;
    outline: 0;
    padding: 0;
    position: relative;
    align-items: center;
    user-select: none;
    border-radius: 0;
    vertical-align: middle;
    -moz-appearance: none;
    justify-content: center;
    text-decoration: none;
    background-color: transparent;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

input {
  display: inline-flex;
  outline: none;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #0002;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

button {
  color: #fff;
  background-color: #3f51b5;
  box-shadow: 0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
      padding: 6px 16px;
    font-size: 0.875rem;
    min-width: 64px;
    box-sizing: border-box;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
    font-weight: 400;
    line-height: 1.75;
    border-radius: 4px;
    letter-spacing: 0.02857em;
    text-transform: uppercase;
}

button:hover {
  background-color: #303f9f;
}

button:active {
  box-shadow: 0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%);
}
              
            
!

JS

              
                // @ts-check

const CONTAINER = 'logContainer';

/** 配列の要素数の基準値 */
const BASIS_COUNT = 100000;

/** 配列を`concat`で結合する関数 */
const concatFunc = (a, b) => a.concat(b);
/** 配列をスプレッド構文で結合する関数 */
const spreadFunc = (a, b) => [...a, ...b];

const assessment = (func) => {
  const container = document.getElementById(CONTAINER);
  if (!container) {
    throw new Error('Not found container');
  }
  container.innerHTML = '';

  const arrs = new Array(2).fill(new Array(BASIS_COUNT).fill(0));

  for (let i = 0; i < 10; i++) {
    const start = new Date();
    for (let j = 0; j < 100; j++) {
      func(arrs[0], arrs[1]);
    }
    const end = new Date();

    const li = document.createElement('li');
    li.textContent = `${end.getTime() - start.getTime()}ms`;
    container.append(li);
  }
};

const assessmentConcat = () => assessment(concatFunc);
const assessmentSpread = () => assessment(spreadFunc);

document.getElementById('concat').addEventListener('click', assessmentConcat);
document.getElementById('spread').addEventListener('click', assessmentSpread);

              
            
!
999px

Console