Question on Javascript Requests Cheatsheet

Can someone please tell me what ~__ does in the code below? It was found on the Learn Javascript Syntax: Requests cheat sheet found in the full stack engineer course.

const getSuggestions = async () => {
  const wordQuery = inputField.value;
  const endpoint = `${url}${queryParams}${wordQuery}`;
  try{
const response = __~await~__ __~fetch(endpoint, {cache: 'no-cache'});
    if(response.ok){
      const jsonResponse = await response.json()
    }
  }
  catch(error){
    console.log(error)
  }
}

Thanks

I have the same question, maybe it could be an error from Frontend and print it like that

The specification for ECMAScript (AKA JavaScript) doesn’t say anything about ~await~ syntax.

It does mention ~await a lot though.

https://262.ecma-international.org/13.0/

I’m fairly certain it’s a typo. I love how it’s on a “Syntax” cheat sheet :roll_eyes:

I feel like this pretty much sums up my experience at Codecademy lol

Create a bug report in #community:codecademy-bug-reporting if you think it’s worth fixing.

An important thing to remember is that you should never rely on a single source, especially if you begin to doubt it.

1 Like

If there is one thing I’ve learned from codecademy, it is this.

1 Like

Why was this marked as solved? not sure why I can’t tag @jibs ?

There was no solution given, just a link to some dense documentation (not even an appropriate section).

Since ~await is “mentioned a lot”, can you give some context on how it’s used? The only info I have found regarding ~ is when it’s used as a a bitwise NOT operator, as mentioned here.

Can someone provide an actual solution/clarification? @codecademy

Hey there!

I’ve unmarked that solution, and the typo has been fixed. Thanks for flagging it!

-Mariana
Community Manager

Thanks for the quick response :slightly_smiling_face:

1 Like