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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<link
  rel="stylesheet"
  href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
  integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay"
  crossorigin="anonymous"
/>
<nav id="navbar">
  <header>Js Documentation</header>
  <ul>
    <li><a class="nav-link" href="#Introduction">Introduction</a></li>
    <li><a class="nav-link" href="#What_you_should_already_know">What you should already know</a></li>
    <li><a class="nav-link" href="#JavaScript_and_Java">JavaScript and Java</a></li>
    <li><a class="nav-link"  href="#Hello_World">Hello World</a></li>
    <li><a class="nav-link" href="#Variables">Variables</a></li>
    <li><a class="nav-link" href="#Declaring_Variables">
      Declaring Variables</a></li>
    <li><a class="nav-link" href="#Variables_Scope">Variables Scope</a></li>
    <li> <a class="nav-link" href="#Global_Variables">Global Variables</a> </li>
    <li><a class="nav-link" href="#Constant">Constant</a></li>
    <li><a class="nav-link" href="#Data_Types">Data Types</a></li>
    <li><a class="nav-link" href="#if...else_statement">if...else statement</a></li>
    <li> <a class="nav-link" href="#while_statement">while statement</a> </li>
    <li><a class="nav-link" href="#Function_declaration">Function declaration</a></li>
    <li><a class="nav-link" href="#Reference">Reference</a></li>
  </ul>
</nav>
<main id="main-doc">
  <section class="main-section" id="Introduction">
    <header>
      Introduction
      </header>
      <p>
        JavaScript is a cross-platform, object-oriented scripting language. It
        is a small and lightweight language. Inside a host environment (for
        example, a web browser), JavaScript can be connected to the objects of
        its environment to provide programmatic control over them.
      </p>

      <p>
        JavaScript contains a standard library of objects, such as <code><span class="keyword">Array</span></code>,<code><span class="keyword">Date</span></code>,
        and <code><span class="keyword">Math</span></code>, and a core set of language elements such as operators, control
        structures, and statements. Core JavaScript can be extended for a
        variety of purposes by supplementing it with additional objects; for
        example:
      </p>
      <ul>
        <li>
          <i><b>Client-side JavaScript</b></i> extends the core language by supplying objects
          to control a browser and its <i><b>Document Object Model</b></i> (DOM). For example,
          client-side extensions allow an application to place elements on an
          HTML form and respond to user events such as mouse clicks, form input,
          and page navigation.
        </li>
        <li>
          <i><b>Server-side JavaScript</b></i> extends the core language by supplying objects
          relevant to running JavaScript on a server. For example, server-side
          extensions allow an application to communicate with a database,
          provide continuity of information from one invocation to another of
          the application, or perform file manipulations on a server.
        </li>
      </ul>
  </section>
  <section class="main-section" id="What_you_should_already_know">
    <header>What you should already know</header>
   <p> This guide assumes you have the following basic background:</p>
      <ul>
        <li>A general understanding of the Internet and the World Wide Web (WWW).</li>
        <li>Good working knowledge of HyperText Markup Language (HTML).</li>
        <li>Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript</li>
      </ul>
  </section>
 <section class="main-section" id="JavaScript_and_Java">
    <header>
     JavaScript and Java
      </header>
     <p>JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.</p>
     <p>In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.</p>
     <p>JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes, and methods. You do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly typed.</p>
     <p>Java is a class-based programming language designed for fast execution and type safety. Type safety means, for instance, that you can't cast a Java integer into an object reference or access private memory by corrupting Java bytecodes. Java's class-based model means that programs consist exclusively of classes and their methods. Java's class inheritance and strong typing generally require tightly coupled object hierarchies. These requirements make Java programming more complex than JavaScript programming.</p>
     </section>
  <section class="main-section" id="Hello_World">
    <header>
     Hello World
      </header>
      <p>To get started with writing JavaScript, open the Web Console in multi-line mode, and write your first "Hello world" JavaScript code:</p>
      <pre class="brush: js notranslate"><code><span class="keyword">function</span> <span class="function">greetMe</span><span class="punctuation">(</span><span class="parameters">yourName</span><span class="punctuation">)</span> <span class="punctuation">{</span>
  <span class="function">alert</span><span class="punctuation">(</span><span class="string">"Hello "</span> <span class="operator">+</span> yourName<span class="punctuation">)</span>
<span class="punctuation">}</span>
<span class="function">greetMe</span><span class="punctuation">(</span><span class="string">"World"</span><span class="punctuation">)</span><span class="punctuation">;</span>
</code></pre>
      <p>Select the code in the pad and hit <kbd>Ctrl</kbd>+<kbd>R</kbd> to watch it unfold in your browser!</p>
  </section>
  <section class="main-section" id="Variables">
    <header>
      Variables
      </header>
      <p>You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules.</p>
      <p>A JavaScript identifier must start with a letter, underscore (<code>_</code>), or dollar sign (<code><span class="number">$</span></code>); subsequent characters can also be digits (<code><span class="number">0</span></code>-<code><span class="number">9</span></code>). Because JavaScript is case sensitive, letters include the characters "<code>A</code>" through "<code>Z</code>" (uppercase) and the characters "<code>a</code>" through "<code>z</code>" (lowercase).</p>
      <p>You can use ISO 8859-1 or Unicode letters such as <code>å</code> and <code>ü</code> in identifiers. You can also use the Unicode escape sequences as characters in identifiers. Some examples of legal names are <code><span class="function">Number_hits</span></code>, <code><span class="function">temp99</span></code>, and <code><span class="function">_name</span></code>.</p>
</section>
  <section class="main-section" id="Declaring_Variables">
    <header>Declaring Variables</header>
      You can declare a variable in three ways:
      <p>With the keyword var. For example,<code><span class="keyword">var</span> x <span class="opreator">=</span> <span class="number">42</span> <span class="punctuation">.</span></code>This syntax
        can be used to declare both local and global variables.</p>
      <p>By simply assigning it a value. For example,<code>x <span class="opreator">=</span> <span class="number">42</span> <span class="punctuation">.</span></code>This always declares a global variable. It generates a strict JavaScript warning. You shouldn't use this variant.</p>
      <p>With the keyword let. For example,<code><span class="keyword">let</span> y <span class="opreator">=</span> <span class="number"> 13</span> <span class="punctuation">.</span></code>This syntax can be used to declare a block scope local variable. See Variable scope below.</p>
  </section>
  <section class="main-section" id="Variables_Scope">
    <header>
     Variables Scope
      </header>
      <p>When you declare a variable outside of any function, it is called a <i><b>global</b></i> variable, because it is available to any other code in the current document. When you declare a variable within a function, it is called a local variable, because it is available only within that function.</p>
      <p>JavaScript before ECMAScript 2015 does not have block statement scope; rather, a variable declared within a block is local to the function (or global scope) that the block resides within. For example the following code will log <code><span class="number">5</span></code>, because the scope of <code>x</code> is the function (or global context) within which <code>x</code> is declared, not the block, which in this case is an <code><span class="keyword">if</span></code> statement.</p>
      <pre><code><span class="keyword">if</span> <span class="punctuation">(</span><span class="boolean">true</span><span class="punctuation">)</span> <span class="punctuation">{</span> <span class="keyword">var</span> x <span class="opreator"> =</span> <span class="number">5</span> <span class="punctuation">;</span> <span class="punctuation">}</span> console<span class="punctuation">.</span> <span class="function">log</span> <span class="punctuation">(</span> <span>x</span> <span class="punctuation">)</span> <span class="punctuation">;</span> <span class="comment">// x is 5</span></code> </pre>
      <p>This behavior changes, when using the <code><span class="keyword">let</span></code> declaration introduced in ECMAScript 2015.</p>
      <pre><code><span class="keyword">if</span> <span class="punctuation">(</span> <span class="boolean">true</span> <span class="punctuation">)</span> <span class="punctuation">{</span> <span class="keyword">let</span> y <span class="opreator">=</span> <span class="number">5</span> <span class="punctuation">;</span>  <span class="punctuation">}</span> console <span class="punctuation">.</span> <span class="function">log</span> <span class="punctuation">(</span> y <span class="punctuation">)</span> <span class="punctuation">;</span> <span class="comment">// ReferenceError: y is not
defined</span></code></pre>
  </section>

<section class="main-section" id="Global_Variables">
    <header>
     Global Variables
      </header>
  <p>Global variables are in fact properties of the global object. In web pages the global object is window, so you can set and access global variables using the <code><span>window.<i>variable</i></span></code> syntax.</p>
    <p>Consequently, you can access global variables declared in one <code><span class="keyword">window</span></code> or <code><span class="keyword">frame</span></code> from another window or frame by specifying the window or frame name. For example, if a variable called <code>phoneNumber</code> is declared in a document, you can refer to this variable from an <code><span class="keyword">iframe</span></code> as <code>parent.phoneNumber</code>.</p>
  </section>
    <section class="main-section" id="Constant">
    <header>
     Constant
      </header>
        <p>You can create a read-only, named constant with the const keyword. The syntax of a constant identifier is the same as for a variable identifier: it must start with a letter, underscore or dollar sign <code><span class="punctuation">(</span><span class="number">$</span><span class="punctuation">)</span></code>and can contain alphabetic, numeric, or underscore characters.</p>
        <pre><code><span class="keyword">const</span> <span class="boolean">PI</span> <span class="opreator">=</span>  <span class="number">3.14</span> <span  class="punctuation">;</span></code></pre>
        <p>A constant cannot change value through assignment or be re-declared while the script is running. It has to be initialized to a value.</p>
        <p>The scope rules for constants are the same as those for let block scope variables. If the const keyword is omitted, the identifier is assumed to represent a variable.</p>
        <p>The scope rules for constants are the same as those for <code><span class="keyword">let</span></code> block scope variables. If the <code><span class="keyword">const</span></code> keyword is omitted, the identifier is assumed to represent a variable.</p>
        <pre><code><span class="comment">// THIS WILL CAUSE AN ERROR function</span>
      <span class="function">f</span> <span class="punctuation">()</span> <span class="punctuation">{}</span> <span class="punctuation">;</span> <span class="keyword">const</span> <span class="function">f</span>  <span class="opreator">=</span> <span class="number">5</span> <span class="punctuation">;</span> <span class="comment">
     // THIS WILL
CAUSE AN ERROR ALSO function</span> 
<span class="function">f</span > <span class="punctuation">(</span> <span class="punctuation">)</span> <span class="punctuation">{</span> <span class="keyword">const</span>g<span class="operator">=</span> <span class="number">5</span> <span class="punctuation">;</span> <span class="keyword">var</span>g<span class="punctuation">;</span> <span class="comment">//statements</span> <span class="punctuation">} </span></code></pre>
        <p>However, object attributes are not protected, so the following statement is executed without problems.</p>
        <pre><code><span class="keyword">const</span> <span class="function">MY_OBJECT</span> <span class="opreator">=</span> <span class="punctuation">{</span><span class="string">"key"</span><span class="punctuation">:</span><span class="string">"value"</span><span class="punctuation">}</span><span class="punctuation">;</span>
<span class="function">MY_OBJECT</span><span class="punctuation">.</span><span>key</span> <span class="opreator">=</span> <span class="string">"otherValue"</span><span class="punctuation">;</span></code></pre>
  </section>
  <section class="main-section" id="Data_Types">
    <header>
     Data Types
      </header>
      <p>The latest ECMAScript standard defines seven data types:</p>
      <ul>
        <li>
          <p>Six data types that are primitives:</p>
          <ol>
            <li><a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean" target="_blank">Boolean</a>. <code><span class="boolean">true</span></code> and <code><span class="boolean">false</span></code>.</li>
            <li>
              <a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/Null" target="_blank">null</a>. A special keyword denoting a null value. Because JavaScript
              is case-sensitive, <code><span class="keyword">null</span></code> is not the same as <code><span class="keyword">Null</span></code>, <code><span class="keyword">NULL</span></code>, or any
              other variant.
            </li>
            <li><a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/undefined" target="_blank">undefined</a>. A top-level property whose value is undefined.</li>
            <li><a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/Number" target="_blank">Number</a>. <code><span class="number">42</span></code> or <code><span class="number">3.14159</span></code>.</li>
            <li> <a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/String" target="_blank">String </a>. A sequence of characters that represent a text value. For example: "Howdy"</li>
            <li> <a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/BigInt" target="_blank">BigInt</a>. An integer with arbitrary precision. For example: <code><span class="number">9007199254740992n</span></code>.</li>
            <li>
             <a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/Symbol" target="_blank">Symbol</a> (new in ECMAScript 2015). A data type whose instances are
              unique and immutable.
            </li>
          </ol>
        </li>
        <li>and <a class="a" href="https://developer.mozilla.org/en-US/docs/Glossary/Object" target="_blank">Object</a></li>
        </ul>
        <p>Although these data types are a relatively small amount, they enable you
      to perform useful functions with your applications. Objects and functions
      are the other fundamental elements in the language. You can think of
      objects as named containers for values, and functions as procedures that
      your application can perform.</p>
  </section>
  <section class="main-section" id="if...else_statement">
    <header>
     if...else statement
      </header>
        <p>Use the <code><span class="keyword">if</span></code> statement to execute a statement if a logical condition is <code><span class="boolean">true</span></code>. Use the optional <code><span class="keyword">else</span></code> clause to execute a statement if the condition is <code><span class="boolean">false</span></code>.</p>
        <p>An <code><span class="keyword">if</span></code> statement looks as follows:</p>
        <pre><code><span class="keyword">if</span> <span class="punctuation">(</span> condition <span class="punctuation">)</span> <span class="punctuation">{</span> 
  statement_1<span class="punctuation">;</span> 
  <span class="punctuation">}</span> <span class="keyword">else</span> <span class="punctuation"> {</span> 
  statement_2 <span class="punctuation">;</span> <span class="punctuation">}</span></code></pre>
  <p><code><i>condition</i></code> can be any expression that evaluates to <code><span class="boolean">true</span></code> or <code><span class="boolean">false</span></code>. See Boolean for an explanation of what evaluates to <code><span class="boolean">true</span></code> and <code><span class="boolean">false</span></code>. If <code><i>condition</i></code>  evaluates to <code> <span class="boolean">true</span></code> , <code><i>statement_1</i></code> is executed; otherwise, <code><i>statement_2</i></code>is executed. <code><i>statement_1</i></code> and <code><i>statement_2</i></code> can be any statement, including further nested <code><span class="keyword">if</span></code> statements.</p>
  <p>You may also compound the statements using <code><span class="keyword">else if</span></code>to have multiple conditions tested in sequence, as follows:</p>
  <pre><code><span class="keyword">if</span> <span class="punctuation">(</span>condition_1<span class="punctuation">)</span> <span class="punctuation">{</span>
<span>statement_1</span><span class="punctuation">;</span> 
<span class="punctuation">}</span> <span class="keyword">else if</span> <span class="punctuation">(</span>condition_2<span class="punctuation">)</span> <span class="punctuation">{</span> 
statement_2<span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="keyword">else if</span> <span class="punctuation">(</span>condition_n<span class="punctuation">)</span> <span class="punctuation">{</span> 
statement_n<span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="keyword">else</span> <span class="punctuation">{</span>
<span>statement_last</span><span class="punctuation">;</span>
<span class="punctuation">}</span></code></pre>
<p>In the case of multiple conditions only the first logical condition which evaluates to <code><span class="boolean">true</span></code> will be executed. To execute multiple statements, group them within a block statement <code><span class="punctuation">({</span></code> ... <code><span class="punctuation">})</span></code>.</p>
<p>In general, it's good practice to always use block statements, especially when nesting <code><span class="keyword">if</span></code> statements:</p>
<pre><code><span class="keyword">if</span> <span class="punctuation">(</span>condition<span class="punctuation">)</span> <span class="punctuation">{</span>
  statement_1_runs_if_condition_is_true<span class="punctuation">;</span>
  statement_2_runs_if_condition_is_true<span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="keyword">else</span> <span class="punctuation">{</span>
  statement_3_runs_if_condition_is_false<span class="punctuation">;</span>
  statement_4_runs_if_condition_is_false<span class="punctuation">;</span>
<span class="punctuation">}</span>
</code></pre>
<p>It is advisable to not use simple assignments in a conditional expression, because the assignment can be confused with equality when glancing over the code. For example, do not use the following code:</p>
<pre><code><span class="keyword">if</span><span class="punctuation">(</span>x <span class="operator">=</span> y<span class="punctuation">)</span><span class="punctuation">{</span>
  <span class="comment">/* statements here */</span>
<span class="punctuation">}</span>
</code></pre>
<p>If you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment. For example:</p>
<pre><code><span class="keyword">if</span><span class="punctuation">(</span><span class="punctuation">(</span>x <span class="operator">=</span> y<span class="punctuation">)</span><span class="punctuation">)</span> <span class="punctuation">{</span>
  <span class="comment">/* statements here */</span>
<span class="punctuation">}</span>
</code></pre>
  </section>
  <section class="main-section" id="while_statement">
    <header> 
      while statement
    </header>
    <p>A while statement executes its statements as long as a specified condition evaluates to  <code><span class="boolean">true</span></code> . A <code><span class="keyword">while</span></code> statement looks as follows:</p>
    <pre><code><span class="keyword">while</span> <span class="punctuation">(</span>condition<span class="punctuation">)</span>
    statement</code></pre>
      <p>If the <code><i>condition</i></code> becomes <code><span class="boolean">false</span></code>, <code><i>statement</i></code> within the loop stops executing and control passes to the statement following the loop.</p>
    <p>The <code><i>condition</i></code> test occurs before <code><i>statement</i></code> in the loop is executed. If the condition returns<code><span class="boolean">true</span></code>, <code><i>statement</i></code> is executed and the <code><i>condition</i></code> is tested again. If the condition returns <code><span class="boolean">false</span></code>, execution stops and control is passed to the statement following <code><span class="keyword">while</span></code>.</p>
    <p>To execute multiple statements, use a block statement <code><span class="punctuation">({</span></code> ... <code><span class="punctuation">})</span></code> to group those statements.</p>
    <h1>Example:</h1>
    <p>The following <code><span class="keyword">while</span></code> loop iterates as long as <code>n</code> is less than <code><span class="number">3</span></code>:</p>
    <pre><code><span class="keyword">var</span> n <span class="opreator">=</span> <span class="number">0</span><span class="punctuation">;</span> 
<span class="keyword">var</span> x <span class="opreator">=</span> <span class="number">0</span><span class="punctuation">;</span>
<span class="keyword">while</span> <span class="punctuation">(</span> <span>n</span><span> &#60; </span><span class="number">3</span><span class="punctuation">)</span> <span class="punctuation">{</span>
  <span>n</span><span class="opreator">++</span><span class="punctuation">;</span>
  <span>x</span> <span class="opreator">+=</span> <span>n</span><span class="punctuation">;</span>
<span class="punctuation">}</span> </code>
</pre>
  </section>
   <section class="main-section" id="Function_declaration">
    <header>
      Function declaration
    </header>
     <p> A <b>function definition</b> (also called a <b>function declaration</b>, or <b>function statement</b>) consists of the <a class="a" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" target="_blank">function</a> keyword, followed by:
      </p>
      <ul>
        <li>The name of the function.</li>
        <li>
          A list of arguments to the function, enclosed in parentheses and
          separated by commas.
        </li>
        <li>
          The JavaScript statements that define the function, enclosed in curly
          brackets, <code><span class="punctuation">{ }</span></code>.
        </li>
      </ul>
      <p>
        For example, the following code defines a simple function named <code>square</code>:
      </p>
<pre><code><span class="keyword">function</span> <span class="number">square</span><span class="punctuation">(</span><span>number</span><span class="punctuation">)</span> <span class="punctuation">{</span>
<span class="keyword">return</span> <span>number</span> <span class="opreator">*</span> <span>number</span><span class="punctuation">;</span>
<span class="punctuation">}</span></code></pre>
     <p>The function <code>square</code> takes one argument, called <code>number</code>. The function consists of one statement that says to return the argument of the function (that is, <code>number</code>) multiplied by itself. The <a class="a" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return" target="_blank">return</a> statement specifies the value returned by the function.</p>
<pre><code><span class="keyword">return</span> <span>number</span> <span class="opreator">*</span> <span>number</span><span class="punctuation">;</span></code></pre>
     <p>Primitive parameters (such as a number) are passed to functions <b>by value</b>; the value is passed to the function, but if the function changes the value of the parameter, <b>this change is not reflected globally or in the calling function</b>.</p>
  </section>
   <section class="main-section" id="Reference">
    <header>
      Reference
    </header>
      <ul>
        <li>
          All the documentation in this page is taken from
          <a class="a" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide"
            target="_blank"
            >MDN</a>
        </li>
      </ul>
  </section>
  <section class="contact-section">
    <div class="contact-links">
    <a
      href="https://codepen.io/your-work"
      target="_blank"
      class="btn contact-details"
       ><i class="fab fa-codepen"></i></a>
      <a
      href="#"
      target="_blank"
      class="btn contact-details"
      ><i class="fab fa-facebook-square"></i></a
    >
  <a
     href="#" 
     target="_blank"
     class="btn contact-details"
     ><i class="fab fa-instagram"></i>
  </a>
    </div>
  </section>
  <footer>
    <p>Created by Eman Zulfiqar |©2021</p>
  </footer>
  </main>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500&display=swap');
*{
  box-sizing:border-box;
  scroll-behavior: smooth;
}
#navbar{
  height: 100%; 
  width: 290px; 
  position: fixed; 
  z-index: 1; 
  top: 0;
  left: 0;
  padding-top: 20px;
  border-right:5px solid #000a2d;
  overflow-y:scroll;
}
#navbar a{
  font-size:1.25rem;
  display:block;
  text-decoration:none;
  color:#00008B;
  cursor:pointer;
  padding: 6px 8px 0px 6px;
  
  }
#navbar a:hover{
  font-size:1.3rem;
  color:#4682B4;
  text-decoration:none;
  transition:all ease-in 0.5s;
}
#navbar li{
  list-style:none;
  position:relative;
  width:100%;
  animation: slide 1s ease forwards;
	opacity:0;
}
  #navbar li:nth-child(1){animation-delay:1.5s;}
	#navbar li:nth-child(2){animation-delay:3.2s;}
	#navbar li:nth-child(3){animation-delay:4.2s;}
	#navbar li:nth-child(4){animation-delay:5.2s;}
	#navbar li:nth-child(5){animation-delay:6.2s;}
	#navbar li:nth-child(6){animation-delay:7.2s;}
	#navbar li:nth-child(7){animation-delay:8.2s;}
#navbar li:nth-child(8){animation-delay:9.2s;}
#navbar li:nth-child(9){animation-delay:10.2s;}
#navbar li:nth-child(10){animation-delay:11.2s;}
#navbar li:nth-child(11){animation-delay:12.2s;}
#navbar li:nth-child(12){animation-delay:13.2s;}
#navbar li:nth-child(13){animation-delay:14.2s;}
#navbar li:nth-child(14){animation-delay:15.2s;}
	@keyframes slide{
		from{transform: translatex(-20px);}
		to{opacity:1;}
	}
#navbar ul{
  height:100%;
  padding:0;
}
body,html{
  font-family:'Rajdhani',monospace;
  font-size:1.125rem;
  line-height:1.5;
  max-width:100%;
  height:100%;
}
#main-doc{
  position:absolute;
  padding-left:290px;
  max-width:96%;
}
header{
  font-size:1.5rem;
  background-color:#212121;
  color:#fff;
  font-weight:500;
  padding:0 30px;
  max-width:max-content;
  margin:auto;
}
#main-doc header{
    font-size:1.5rem;
    background-color: #212121;
    color: #fff;
    font-weight: 400;
    max-width: max-content;
    padding: 0 6px;
    margin: 24px 0;
}
.a{
  text-decoration:none;
  color:#00008B;
}
.a:hover{
  font-size:1.3rem;
  color:#4682B4;
  text-decoration:none;
  transition:all ease-in 0.5s;
}
ul{
  list-style-type:square;
}
/*css for styling code*/
code, pre {
    background-color:#eee;
}
pre {
    box-sizing:border-box;
    background:#eee;
    border-left: 6px solid #000000;
    box-shadow: 0 1px 2px 1px #cdd5d7;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0 24px;
    overflow: auto;
    padding: 24px;
    width: 92%;
}
.keyword{
  color:#00458b;
}
.function{
  color:#b54248;
}
.parameters{
  color:#000;
}
.punctuation{
  color:#999;
}
.string{
  color:#276738;
}
.boolean,.number{
  color:#905;
}
.opreator{
  color:#212121;
}
.comment{
  color:#626262;
}

kbd {
  background: linear-gradient(
180deg
,#eee,#fff);
    background-color: #eee;
    border: 1px solid #cdd5d7;
    border-radius: 6px;
    box-shadow: 0 1px 2px 1px #cdd5d7;
    font-family:consolas,courier new,monospace;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    margin: 3px;
    padding: 4px 6px;
    white-space: nowrap;
}
::-webkit-scrollbar{
	width:14px;
}
::-webkit-scrollbar-thumb{
	background: linear-gradient(45deg, #7f7f7f, #e1dfdf, #7f7f7f);
	border-radius: 10px;
}
::-webkit-scrollbar-track{
	box-shadow: inset 1px 2px 4px grey; 
	background-color:#F5F5F5;
}
@keyframes spining {
  from {transform: rotate(0deg);}
  to {transform: rotate(360deg);}
}
@media only screen and (max-width:805px){
 #navabr ul {
    max-height:260px;
  }
   #navbar{
     position:absolute;
     z-index:1;
     width:100%;
     top:0;
     margin:0;
     padding:0;
     padding-top:2px;
     max-height:260px;
     border:solid 2px #000000;
     text-align:center;
     }

  #main-doc{
    margin-top:260px;
    width:100%;
    margin-left:0;
    padding-left:0;
  }
  pre{
    width:92%;
  }
}

/*links*/
.btn {
  display:in-line;
  padding: 0 1rem;
  border-radius: 2px;
  line-height:2;
}
.contact-section {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}
.contact-links {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 980px;
  flex-wrap:wrap;
  margin:0.2rem 0;
}
.contact-links a{
  color:#000000;
  text-decoration:none;
}

.contact-details {
  font-size: 2rem;
  text-shadow: 1px 1px 1px #000;
  transition: transform 0.3s ease-out;
}

.contact-details:hover {
  transform: translateX(4px);
  text-shadow: 1px 1px 3px #000;
}


/*footer*/
footer {
	padding: 0;
  margin:0;
}

footer p {
	font-size: 1.2rem;
	text-align: center;
}

              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console