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

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                console.log("因為是把定長度縮減,仍是在同一個記憶體的位址上");
let arrA = ["Hi", "Hello", "yep", "chao", "wow"];
arrB = arrA;
console.log("arrA : ", arrA);
console.log("arrB : ", arrB);

arrB.length = arrB.length - 1;
console.log("arrA : ", arrA);
console.log("arrB : ", arrB);
console.log("-------------------------------------------");

console.log("因為是指定長度為零,仍是在同一個記憶體的位址上");
let arrC = ["Hi", "Hello", "yep", "chao", "wow"];
arrD = arrC;
console.log("arrA : ", arrC);
console.log("arrB : ", arrD)

arrD.length = 0;
console.log("arrC : ", arrC);
console.log("arrD : ", arrD);
console.log("-------------------------------------------")

console.log("這種方式不會更動到原陣列,因為 arrF = [] -> Javascript 會找一個新的記憶體位址,指定給 arrF 用。");
let arrE = ["Hi", "Hello", "yep", "chao", "wow"];
arrF = arrE;
console.log("arrE : ", arrE);
console.log("arrF : ", arrF);

arrF = [];
console.log("arrE : ", arrE);
console.log("arrF : ", arrF);
console.log("-------------------------------------------")
              
            
!
999px

Console