Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
I am trying to send back data to the client. But the data that is console.logged in my client does not show the JSON data

When I console.log the data, I get ƒ json() { [native code] }.

This is my client-side code:

            async function getthetime() {
                const thetime = await fetch('getActivity');
                const json = await thetime.json
                console.log(json);
            }

I set a get request to the api endpoint, took the incoming data and turned it into json, and console.logged that.

This is a snippet of my serverside code:

  app.get('/getActivity', async (req, res) => { 
         var task = {"task":getTask(data,time)};
         res.send(task);
  }

When I simply console.log(task), I get exactly what I want in the terminal. For some reason I am unable to properly send that as a response.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!