Complete noob in javascript, any resources for javascript itself as well using axios in javascript

if anyone has any good resources to learn more about javascript as well as using axis in javascript to interact with API that would be great :slight_smile:

Hello!

First of all, welcome to the forum :partying_face:!

Well, I would suggest you to start by taking the Free Code Camp’s course APIs and Microservices. It doesn’t teach you about Axios, but this library is easy to use, so you shouldn’t have any problems to understand it after you get a grasp of what an API (or endpoint) is.

For example, to retrieve data from a REST API endpoint using GET:

// this line may change depending on the context, front or back end.
const axios = require('axios');

axios.get('https://someapi.com/api/v1/greetings')
.then((response) => console.log(response))
.catch(e => console.error('Failed to retrieve the data:', e));

A real example would be this:

// from a front end library, like React or Vue

import axios from 'axios';

axios.get('https://jsonplaceholder.typicode.com/todos/1')
.then(response => console.log(response))
.catch(e => console.error('Failed to retrieve the data:', e));

You can see it working here.

Hope it helps :slight_smile:,

Happy coding!

1 Like

A post was split to a new topic: JavaScript + React