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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                ///////////////////////////////// JavaScript Operator Exercises ////////////////////////////////

// Remember to print your results to the console to check your answers.
// To print to the console, use the following syntax: console.log(variableName);
// Use your newfound knowledge of string operators to print fixed values and variables in the same statement,

let printing = "printing this";
console.log(printing);

let visitCount = 5000320;
console.log("This site has had " + visitCount + " visitors, and counting!");

// OR - with string literals
console.log(`This site has had ${visitCount} visitors and counting!`)

// To view the console, click the console button at the bottom left corner, next to the "assets" and "comments" buttons. You can erase statements printed to the console to have a clean slate by clicking "clear".

// 1. Declare two variables, x and y, and assign them to different numeric values of your choosing.

// - Declare a new variable, z, and assign it to the sum of x and y

// - Print the following sentence in the same format: "The sum of __ and __ is ___." where the value of x is in the first blank, y is in the second blank, and z is in the third blank.

// - Declare a new variable, i. and assign it to the quotient of z divided by 9.

// - Implement a conditional operator that assigns the value of i to 5 if the quotient of z divided by 9 is less than 12. If the quotient is greater than 12, assign i to the value of 90.

// - Print the value of i in the following format, using operations to print the variable in place of the blanks: "The value of variable i is _(i)_ because _(z)_ divided by 9 is __(print quotient of z divided by 9 without saving it to a variable)__."

// 2. Reduce the following 10 lines of code to 3 lines of code:

let value1 = 7;
let value2 = 9;
value2 = value1 + value2;
value2--;

// 3. Create an array containing the names of 5 friends.
// - Append the last name of each friend to their respective element (the element with their name)
// - Print out the corresponding names of each friend for the following sentences:
// - "My oldest friend is ______."
// - "My funniest friend is ______."
// - "My __(insert some adjective)__ friend is _______."
// - "My __(insert some adjective)__ friend is _______."
// - "My __(insert some adjective)__ friend is _______."

              
            
!
999px

Console