Pen Settings

HTML

CSS

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
  </body>
</html>

              
            
!

CSS

              
                
              
            
!

JS

              
                function _curry2(fn) {
  return function f2(a, b) {
    switch (arguments.length) {
      case 0:
        return f2
      case 1:
        return _curry1(function(_b) {
          // 将参数从右到左依次赋值 1 2 第一次执行时,是 fn(a, 1)
          return fn(a, _b)
        })
      default:
        // 参数长度是 2 时 直接进行计算
        return fn(a, b)
    }
  }
}

function _curry1(fn) {
  return function f1(a) {
    // 对参数长度进行判断
    if (arguments.length === 0) {
      return f1
    } else {
      // 通过 apply 来返回函数 fn(a, 1)
      return fn.apply(this, arguments)
    }
  }
}

const add = _curry2(function add(a, b) {
  return Number(a) + Number(b)
})

// 第一次调用是 fn(a, 1)
let r1 = add(1)

// 第二次调用是 fn(2,1)
let r2 = r1(2)

console.log('result', r2)

              
            
!
999px

Console