Skip to content
Foxipa
Code Completion 8 Challenges

JavaScript Source Text, Lexical Grammar & Parsing — Code Completion

Practice recognizing source-level grammar constructs, directives, literals, comments, and statement boundaries.

Challenge 1

Declare a variable with a lexical declaration.

javascript Your answer
const source = ;

Press Ctrl⌘Enter to check your answer

Challenge 2

Write a regular expression literal.

javascript Your answer
const pattern = ;

Press Ctrl⌘Enter to check your answer

Challenge 3

Create a template literal containing name.

javascript Your answer
const message = ;

Press Ctrl⌘Enter to check your answer

Challenge 4

Return without putting the expression on a new line.

javascript Your answer
function value() { return ; }

Press Ctrl⌘Enter to check your answer

Challenge 5

Add an explicit statement terminator.

javascript Your answer
const total = 1 + 2

Press Ctrl⌘Enter to check your answer

Challenge 6

Add a strict-mode directive.

javascript Your answer
function run() { 
 return 1;
}

Press Ctrl⌘Enter to check your answer

Challenge 7

Use a classifying comment without changing execution.

javascript Your answer
const value = 1; 
const result = value;

Press Ctrl⌘Enter to check your answer

Challenge 8

Create a module export declaration.

javascript-module Your answer
export const answer = ;

Press Ctrl⌘Enter to check your answer