Why is this JSON property being logged as undefined?
问题 I have a nodejs lambda that has an SQS queue as an event, which is subscribed to an SNS topic. The lambda looks like this: 'use strict'; import { Handler } from 'aws-lambda'; const myLambda: Handler = async (event: any = {}) => { let incomingMessage = JSON.stringify(event.Records[0].body); console.log('Received event:', incomingMessage); # log1 console.log('parsed event',JSON.parse(incomingMessage)); # log2 var type = JSON.parse(JSON.stringify(incomingMessage)).Type; console.log('Message