cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class='container-fluid'>
  <!-- Nav tabs -->
  <ul class="nav nav-tabs" id="myTab" role="tablist">
    <li class="nav-item">
      <a class="nav-link active" data-toggle="tab" href="#problem" role="tab">Challenge</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" data-toggle="tab" href="#example" role="tab">Example</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" data-toggle="tab" href="#testspecs" role="tab">Test Specs</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" data-toggle="tab" href="#run-specs" role="tab">Run Specs</a>
    </li>
  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
    <div class="tab-pane active" id="problem" role="tabpanel">
      <div class='jumbotron'>
        <h3 class='display-3'>Greeting </h3>
        <p class='lead'>
          Create a function <code>greeting(name)</code> that accepts a string argument (a name, ex: <code>"Oliver"</code>), and returns a personalized greeting if a name is present.
        </p>
        <p>
           The function takes a name as its only argument and returns a string. Check the <b>Example</b> and <b>Test Specs</b> tabs to learn more about the function.
        </p>
  </div>

    </div>
    <div class="tab-pane" id="example" role="tabpanel">
      <h4> Examples:</h4>
      <h5> With the "name" argument </h5>
      <pre><code='language-markup'>
        - INPUT: greeting('Charlotte');
        - OUTPUT: "Hello, Charlotte!";
      </code></pre>
      <h5> With the "name" argument </h5>
      <pre><code='language-markdown'>
        - INPUT: greeting();
        - OUTPUT: "Hello!";
      </code></pre>      
    </div>
    <div class="tab-pane" id="testspecs" role="tabpanel">
      <h4> TEST SPECS: </h4>
      <pre> 
<code class="language-javascript"> 
describe('greeting', function(){
	
	it('greeting is a function', function(){
		var functionType = typeof greeting;
		expect(functionType).toEqual('function');
	})

	it('returns a string value', function(){
		var returnValue = greeting(),
				stringType = typeof returnValue;

		expect(stringType).toEqual('string');
	})

	it('returns the string "Hello!" when an argument is NOT passed', function(){
		var returnValue = greeting();

		expect(returnValue).toEqual("Hello!");
	})

	it('returns the string "Hello, Joe!" when an argument IS passed', function(){
		var returnValue = greeting('Joe');

		expect(returnValue).toEqual('Hello, Joe!');
	})

})
</code> 
</pre>
    </div>
    <div class="tab-pane" id="run-specs" role="tabpanel">
      
    </div>
  </div>

</div>
            
          
!
999px
Loading ..................

Console