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

              
                <code class="language-klipse-eval-js">
  
<!-- concat() -->
let  numsOne = [1, 3, 5, 7, 9];
let numsTwo  = [2, 4, 6, 8];
<!-- concatenate** numsOne **and **numsTwo** -->
let concatenated =  numsOne.concat(numsTwo);
<!-- display concatenated array -->
console.log(concatenated);
  
<!-- sort()  -->  
<!-- Sort the concatenated array -->
<!-- Sort occurs in-place -->
concatenated.sort();
console.log(concatenated);
  
<!-- entries() 
     working with an iterator
-->
let numeros = ['zero', 'uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete', 'ocho', 'nueve'];
<!-- Convert numeros into an iterator  -->
let myIterator = numeros.entries();

console.log(myIterator.next().value); 
console.log(myIterator.next().value);   
    
let result = myIterator.next(); 
 while ( !result.done ) 
  {
     console.log(result.value);
     result = myIterator.next();
  }
  
 
<!-- every() -
 We will test the following criteria or condition:
 All array elements < 50. 
-->                                                                                
let nums = [10, 20, 15, 30, 35, 25, 40, 47];
if (nums.every( (n) => { return  n < 50; })) 
{ console.log("All elements in array are < than 50!!"); }
else
{ console.log("Not all elements are < than 50!!"); }

<!--  OR  -->
                                    
const isCurrentValueLessThan_50 = (value) => value < 50;

if (nums.every( isCurrentValueLessThan_50))
{ console.log("All elements in array are < than 50!!"); }
else
{ console.log("Not all elements are < than 50!!") }
                                                        
                                                        
<!-- filter()  -->
<!-- create a new array from all the elements in numeros where the length 
     is > 4
-->                                                        
numeros = ['zero', 'uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete', 'ocho', 'nueve'];

const lengthGreaterThan_4 = numeros.filter( numero  => numero.length > 4);
console.log(lengthGreaterThan_4);                                                        
                                                        
<!-- find()  -->
<!-- find first array element > 10  -->
let numFound = nums.find(element => element > 10);
console.log(numFound);                                                      
 

<!--  lastIndexOf()  -->
<!-- find las index of 20 -->
let array = [10, 20, 15, 30, 35, 25, 20, 40, 47, 20, 25, 30];
console.log(array.lastIndexOf(20));

<!-- map()  -->
array = [10, 20, 15, 30, 35, 25, 20, 40, 47, 20, 25, 30];
let mapArray = array.map(element => element * element);
console.log(mapArray);
                    
<!-- toString() -->
<!-- convert array arr1 to a string  -->
let arr1 = [10, 20, 15, 30, 35, 25, 20, 40, 47];
let arrayToString = arr1.toString();
console.log (arr1.toString());
                                                        
</code>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console