Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4604066
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:14:30+00:00 2026-05-22T00:14:30+00:00

{ @: { xmlns: http://ses.amazonaws.com/doc/2010-12-01/ }, SendEmailResult: { MessageId: 0000012fdd10caaf-021c6e9e-e872-4b35-ad94-1d11c79a6324-000000 }, ResponseMetadata: { RequestId:

  • 0
{
    "@": {
        "xmlns": "http://ses.amazonaws.com/doc/2010-12-01/"
    },
    "SendEmailResult": {
        "MessageId": "0000012fdd10caaf-021c6e9e-e872-4b35-ad94-1d11c79a6324-000000"
    },
    "ResponseMetadata": {
        "RequestId": "736d5bb2-7b7d-11e0-b435-f7b0c9315f0d"
    }
}

How do I check if “MessageId” exists in a object? (without throwing errors)
I might get other json objects returned, and I need to know if the one I get has a “MessageId”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:14:31+00:00Added an answer on May 22, 2026 at 12:14 am

    Assuming you have a reference to it in obj, then:

    if (obj && obj.SendEmailResult && "MessageId" in obj.SendEmailResult) {
        // The "MessageId" property exists in `obj.SendEmailResult`
    }
    

    Probably more usefully, though:

    var msgid = obj && obj.SendEmailResult && obj.SendEmailResult.MessageId;
    if (msgid) {
        // The property exists and is "truthy", `msgid` is the value
    }
    

    JavaScript’s AND operator && is more useful than that of some other languages, it returns the right-hand side’s value if both of its operands are “truthy” (rather than just returning a true / false result, as in most languages). A “truthy” value is a value that is not “falsy” (obviously). “Falsy” values are false, undefined, null, "", and 0.

    So the above basically says “Set msgid to obj.SendEmailResult.MessageId provided that obj and obj.SomeEmailResult both exist.

    (The || operator is similarly powerful.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My XAML code is like this: <Window xmlns ='http://schemas.microsoft.com/netfx/2007/xaml/presentation' xmlns:x ='http://schemas.microsoft.com/winfx/2006/xaml' Title ='Print Preview
I'm using http://code.google.com/p/flex-iframe/ for showing wikicontent in a flex app. <?xml version=1.0?> <mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
My web.xml is like <web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd> <display-name>sample</display-name> <servlet> <servlet-name>Sampleclass</servlet-name> <servlet-class>sample.SampleClass</servlet-class>
i have a file Accelerator.xml <?xml version=1.0 encoding=UTF-8?> <os:openServiceDescription xmlns:os=http://www.microsoft.com/schemas/openservicedescription/1.0> <os:homepageUrl>http://www.sapo.pt</os:homepageUrl> <os:display> <os:name>Find on
I have this persistence unit: <?xml version=1.0 encoding=UTF-8?> <persistence version=1.0 xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd>
xmlns:m=http://www.MangoDSP.com/mav/wsdl as localfile:ma.wsdl xmlns:m0=http://www.MangoDSP.com/schema as localfile:MaTypes.xsd how can i validate it.
Flex4 provides the following namespaces: xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/halo What's the difference? Which namespace provide
I saw the following line in an XML file: xmlns:android=http://schemas.android.com/apk/res/android I have also seen
Using http://xslt.online-toolz.com/tools/xslt-transformation.php .xml <?xml version=1.0?> <my:project xmlns:my=http://myns> <my:properties> <my:property> <my:name>customerId</my:name> <my:value>1</my:value> </my:property> <my:property> <my:name>userId</my:name>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.