Learn Basic String and Array Methods by Building a Music Player - Step 69

I’m getting this error and I don’t understand why I’m using the normal “if” syntax "if (condition) {
do something
}

Yet, the console is giving me this error and won’t even let me check or ask for help becouse the “check you code” does nothing.

// running tests
SyntaxError: unknown: Support for the experimental syntax ‘optionalChainingAssign’ isn’t currently enabled (147:7):

145 |
146 | const deleteSong = (id) => {

147 | if (userData?.currentSong?.id = id) {
| ^
148 |
149 | }

I just added “===” and suddenly it all works!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.