In 4.22 "esri/tasks/Geoprocessor" is depricated
and "esri/rest/geoprocessor" is recommended instaead, so I used it.
geoprocessor.submitJob(gpServiceUrl, gpParams)
.then(function (jobInfo)) {
jobInfo.waitForJobCompletion().then(() => {
jobInfo.fetchResultData("pointFC")
.then(function (result) {
if (result.dataType == "feature-record-set-layer") {
let featureSet = result.value;
console.log(`Points: ${featureSet.features.length}`);// gives "0"
}
});
});
});