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

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

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                /**
 * This pen shows some examples of how to work with arrays using FKit:
 *
 * https://github.com/nullobject/fkit
 *
 * Made with love by @nullobject (http://joshbassett.info), 2014.
 */

const as = [1, 2, 3]

example('#length')(
  // Get the length of an array.
  F.length(as)
)

example('#head')(
  // Get the first element of an array.
  F.head(as)
)

example('#tail')(
  // Get the elements after the first element of an array.
  F.tail(as)
)

example('#init')(
  // Get the elements before the last element of an array.
  F.init(as)
)

example('#last')(
  // Get the last element of an array.
  F.last(as)
)

example('#reverse')(
  // Reverse the elements of an array.
  F.reverse(as)
)

example('#intersperse')(
  // Intersperse an array with a value.
  F.intersperse(4, as)
)

example('#append')(
  // Append an element to an array.
  F.append(4, as)
)

example('#prepend')(
  // Prepend an element to an array.
  F.prepend(0, as)
)

example('#union')(
  // Union two arrays.
  F.union([1, 2, 3], [2, 3, 4])
)

example('#intersect')(
  // Intersect two arrays.
  F.intersect([1, 2, 3], [2, 3, 4])
)

example('#difference')(
  // Difference of two arrays.
  F.difference([1, 2, 3], [2, 3, 4])
)

example('#concat')(
  // Concatenate many arrays.
  F.concat(as, [4], [5], [6])
)

example('#concatMap')(
  // Map a function which produces array over an array and concatenate the
  // results.
  F.concatMap(a => [a, -a], as)
)

example('#map')(
  // Map a function over an array.
  F.map(F.negate, as)
)

example('#filter')(
  // Filter the elements of an array using a predicate function.
  F.filter(F.eq(2), as)
)

example('#fold')(
  // Fold an array with a binary function from left to right.
  F.fold(F.flip(F.prepend), [], as)
)

example('#foldRight')(
  // Fold an array with a binary function from right to left.
  F.foldRight(F.append, [], as)
)

example('#scan')(
  // Scan over an array with a binary function from left to right.
  F.scan(F.flip(F.prepend), [], as)
)

example('#scanRight')(
  // Scan over an array with a binary function from right to left.
  F.scanRight(F.append, [], as)
)

example('#zip')(
  // Zip arrays.
  F.zip(as, [4, 5, 6])
)

example('#zipWith')(
  // Zip arrays with a function.
  F.zipWith(F.add, as, [4, 5, 6])
)

example('#unzip')(
  // Unzip arrays.
  F.unzip([[1, 4], [2, 5], [3, 6]])
)
              
            
!
999px

Console