#Reading Documentation

1 messages · Page 1 of 1 (latest)

hoary chasm
#

I was reading some axios documentation and came across this :

axios.get(url[, config])
axios.post(url[, data[, config]])

what does the syntax mean after "url"?
axios link : https://axios-http.com/docs/api_intro
examples are from the bottom half

formal salmon
#

usually the [] means "optional"

hoary chasm
#

oh okay. what about the comma? since theres nothing infront of it, thats whats also tripping me up

formal salmon
#

ok so the function requires an url, the config is optional. The , just means that if you provide the config, there must be a comma between the URL and the config.