Randell Dawson 05f73ca409 fix(curriculum): Convert blockquote elements to triple backtick syntax for JavaScript Algorithms and Data Structures (#35992)
* fix: convert js algorithms and data structures

* fix: revert some blocks back to blockquote

* fix: reverted comparison code block to blockquotes

* fix: change js to json

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: convert various section to triple backticks

* fix: Make the formatting consistent for comparisons
2019-05-17 08:20:30 -05:00

1.8 KiB

id, title, challengeType, videoUrl
id title challengeType videoUrl
bd7123c9c441eddfaeb4bdef Comment Your JavaScript Code 1 https://scrimba.com/c/c7ynnTp

Description

Comments are lines of code that JavaScript will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what that code does. There are two ways to write comments in JavaScript: Using // will tell JavaScript to ignore the remainder of the text on the current line:
// This is an in-line comment.

You can make a multi-line comment beginning with / and ending with /:

/* This is a
multi-line comment */

Best Practice
As you write code, you should regularly add comments to clarify the function of parts of your code. Good commenting can help communicate the intent of your code—both for others and for your future self.

Instructions

Try creating one of each type of comment.

Tests

tests:
  - text: Create a <code>//</code> style comment that contains at least five letters.
    testString: assert(code.match(/(\/\/)...../g), 'Create a <code>//</code> style comment that contains at least five letters.');
  - text: Create a <code>/* */</code> style comment that contains at least five letters.
    testString: assert(code.match(/(\/\*)([^\/]{5,})(?=\*\/)/gm), 'Create a <code>/* */</code> style comment that contains at least five letters.');

Challenge Seed


Solution

// Fake Comment
/* Another Comment */