0

How can I check if given student.data.subId.dataName is empty or not without using any inbuilt method or library, isEmpty or Object.keys or hasOwnProperty not working in Apache Nifi ExecuteScript's EcmaScript.

Hence I need it in very basic way how can I check if given data is wmpty or not.

I need to check if student.data.subId.dataName is empty or not(in this case it is empty)

const student={
  "status" : "success",
  "data" : {
    "noMoreWork" : 0,
    "subId" : {
      "labelName" : "",
      "dataName" : {
      }
    },
   restflow=[]
  }
}
dash
  • 35
  • 5
  • There are many Q&A on this, with answers dating back from the pre-ES6 period, like [this one](https://stackoverflow.com/a/2673141/5459839) – trincot Jun 01 '23 at 13:14
  • @trincot even hasOwnProperty not working for my case – dash Jun 01 '23 at 13:21
  • Your question is tagged with `ecmascript-5`. If that language does not have `hasOwnProperty` it is not ECMAScript 5. What is the ECMAScript version? – trincot Jun 01 '23 at 13:50
  • @trincot it has to be done without using any inbuilt method, because these methods doesnt workes in apche nifi's pexecute script processor while using ecmascript in executeScript. – dash Jun 01 '23 at 13:53
  • @trincot thats why Iam stucking else there are multiple inbuilt methods for the same – dash Jun 01 '23 at 13:54
  • Listen, your question is tagged with ecmascript-5. Even ECMAScript 3 had support for `hasOwnProperty`... Please tag your question correctly. – trincot Jun 01 '23 at 13:55
  • @trincot leave you are not understanding what I am trying to say, I have removed that tag – dash Jun 01 '23 at 13:57
  • As you can see [here](https://stackoverflow.com/a/51825361/5459839) other people are able to use `Object.keys`, `forEach` and other functions without issue, so there must be something with the version you are running. Please provide full information of version and how you call the script. – trincot Jun 01 '23 at 14:07

0 Answers0