Nullish Fallback

JavaScript Easy 5 views
Back to Questions

Problem Description

Two JSON values are given on two lines: a and b. Print the value of (a ?? b) as JSON (stringified). Remember: only null and undefined trigger the fallback, not 0 or empty string.

Input Format

Line1: JSON value a. Line2: JSON value b.

Output Format

One line JSON output.

Constraints

Inputs are valid JSON (so a cannot be undefined).

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next