var ssid="yourSSID";
var pass="yourPassw";
console.log('connecting to wifi');
ESP8266WiFi.init();
ESP8266WiFi.connect(ssid,pass, function()
{console.log('connected to wifi');
var ipInfo = ESP8266WiFi.getIPInfo();
print("Current IP address is: " +ESP8266WiFi.getAddressAsString(ipInfo.ip)+':'+ESP8266WiFi.getAddressAsString(ipInfo.netmask));
});
The new command wifi.connect() is not too corect