jueves, 20 de julio de 2017

Error: Cannot read property ‘replace’ of undefined [Android]

var num = target.split('(API level ')[1].replace(')', '');
I replaced it with a regex search and extraction:
var num = target.match(/\d+/)[0];