skip to Main Content

Javascript – ERROR : TS2339: Property 'group' does not exist on type '{ rootCause: string; countermeasure?: any; signalName: any; importance: any; }[]'

Code: var dataArray: { rootCause: string, countermeasure?: any, signalName: any, importance: any }[] = [] dataArray.push({ rootCause: x.description, countermeasure: response.countermeasures[ii], signalName: x.signalName, importance: x.importance }) const result = dataArray.group((data: any) => data.rootCause); I`m just having an array of objects, and…

VIEW QUESTION

Add timestamp to API call JSON output

I need to add timestamp in key-value format on a JSON response. This is what I have right now: now = datetime.datetime.now().isoformat(sep=" ", timespec="seconds") result = session.get(urljoin(baseurl, path), headers=headers, params=querystring, verify=False) jsonarray = result.json() json_object = json.dumps(jsonarray) #writing to outputfile…

VIEW QUESTION
Back To Top
Search