From b4bae84bfda22610a4eba82e680ffe04c5d31ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20J=C3=B8rgensen?= <28780271+lasjorg@users.noreply.github.com> Date: Tue, 16 Apr 2024 06:51:04 +0200 Subject: [PATCH] fix(curriculum): correct instructions, add quotes around value (#54406) --- .../645f7879ebbdb201892e55e1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-asynchronous-programming-by-building-an-fcc-forum-leaderboard/645f7879ebbdb201892e55e1.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-asynchronous-programming-by-building-an-fcc-forum-leaderboard/645f7879ebbdb201892e55e1.md index e65fa5cf6a8..3f1ff531221 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-asynchronous-programming-by-building-an-fcc-forum-leaderboard/645f7879ebbdb201892e55e1.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-asynchronous-programming-by-building-an-fcc-forum-leaderboard/645f7879ebbdb201892e55e1.md @@ -9,11 +9,11 @@ dashedName: step-61 Next, you will construct the `userAvatarUrl`. -Start by creating a constant called `userAvatarUrl`. Then use a `ternary` operator to check if `avatar` starts with `/user_avatar/`. +Start by creating a constant called `userAvatarUrl`. Then use a `ternary` operator to check if `avatar` starts with `"/user_avatar/"`. -If so, use the `concat` method to concatenate `avatarUrl` to `avatar`. Otherwise return `avatar`. +If so, use the `concat` method to concatenate `avatar` to `avatarUrl`. Otherwise return `avatar`. -This will ensure the avatar URL is correctly formed whether it's a relative or absolute URL. +This will ensure the avatar URL is correctly formed whether it's a relative or absolute URL. # --hints-- @@ -23,7 +23,7 @@ You should have a constant named `userAvatarUrl`. assert(code.match(/const\s+userAvatarUrl\s*=/)); ``` -You should assign a `ternary` operator to the `userAvatarUrl`. Your `ternary` should check if `avatar` starts with `/user_avatar/` and return `avatarUrl.concat(avatar)` or `avatar`. +Your `ternary` should check if `avatar` starts with `"/user_avatar/"` and return `avatarUrl.concat(avatar)` or `avatar`. ```js assert(code.match(/const\s+userAvatarUrl\s*=\s*(?:avatar\.startsWith\(\s*('|")\/user_avatar\/\1\s*\)|\/\^\\\/user_avatar\\\/\/\.test\(\s*avatar\s*\))\s*\?\s*avatarUrl\.concat\(\s*avatar\s*\)\s*:\s*avatar/));