repl.it
@acwoss/

LoudTastyAfricanwilddog

JavaScript

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var json = '{ \
  "ip": "187.155.67.279", \
  "hostname": "b1c33eb3.virtua.com.br", \
  "city": "Leblon", \
  "region": "Rio de Janeiro", \
  "country": "BR", \
  "loc": "-22.8244,-43.0353", \
  "org": "AS28573 CLARO S.A." \
}';

var response = JSON.parse(json);
var res = Object.keys(response).reduce(function (previous, current) {
  return (previous ? previous + ',' : '') + response[current];
}, "");

console.log(res);
Native Browser JavaScript