Skip to content

Fix: Code block formatting issues on page 14 (Logical operators section) #47

@Oluwasetemi

Description

@Oluwasetemi

Issue Description

Page 14 of the JavaScript Note (fundamentals.md) has multiple code block formatting and consistency issues in the Logical operators and Nullish Coalescing sections.

Location

File: pages/fundamentals.md
Section: Logical operators, Nullish Coalescing, and Conditional Branching
Lines affected: 417, 422-430, 456-461, 484, 497-498

Issues Found

1. Missing space after code fence (Lines 422-424, 428-430)

The code fences are missing a space between 'js' and '{monaco-run}':

  • Line 422: js{monaco-run} should be js {monaco-run}
  • Line 428: js{monaco-run} should be js {monaco-run}

2. Unnecessary comments before alert() (Line 417)

Line 417 has double slashes before alert():

  • // alert(true || false); // alert('Boy' || 4)
    Should be:
  • alert(true || false); alert('Boy' || 4)

3. Unnecessary comments before console.log() (Lines 456-461)

Lines 457 and 460 have unnecessary // before console.log():

  • // console.log(user.address.street);
  • // console.log(user?.address?.street);
    Should not have the // prefix for these examples to demonstrate actual usage.

4. Inconsistent console.log usage (Line 484)

Line 484 uses console.log without comment while other similar examples have it commented:

  • console.log('Today is Monday')
    Should be:
  • // console.log('Today is Monday')
    For consistency with the pattern used in other code examples.

5. Unnecessary comments before alert() (Lines 497-498)

Lines 497-498 have // before alert():

  • // alert('Your size is 20')
  • // alert('Thank you')
    Should be:
  • alert('Your size is 20')
  • alert('Thank you')

Steps to Fix

  1. Open pages/fundamentals.md
  2. Add space after js in code fences on lines 422 and 428
  3. Remove unnecessary // comments before alert() on lines 417, 497-498
  4. Remove unnecessary // comments before console.log() on lines 456-461
  5. Add // before console.log() on line 484 for consistency
  6. Test that the documentation renders correctly

Additional Context

These issues affect the readability and consistency of code examples on page 14.
Related to Issue #46

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions