How can I do the following in JavaScript? I want to load JSON data from the url "https://data.cityofnewyork.us/resource/734v-jeq5.json". And then, take the JSON data that consists of an array of only 'sat_critical_reading_avg_score'. Any help is greatly appreciated.
import json
import urllib.request
def get_data():
response = urllib.request.urlopen("https://data.cityofnewyork.us/resource/734v-jeq5.json")
content = response.read().decode()
response1 = json.loads(content)
result = []
for i in response1:
try:
result.append(
int(i['sat_critical_reading_avg_score'])
)
except:
pass
return result
print(get_data())