ipv4 to int32 js

JavaScript
const ipToInt32 = (ip) => ip.split`.`.reduce((r, e) => r * 256 + +e);
Source

Also in JavaScript: