JSFiddle - React, Tailwind, and code Playground
HTML
<pre id="out"></pre>
JavaScript
function check(data) {
return Object.hasOwn(data, 'd') && data.m === 1;
}
// test
const a = { d: "слово", m: 23, s: "слово 2" };
const b = { d: "слово", m: 1, s: "слово 2" };
const c = { c: "слово", m: 1, s: "слово 2" };
log('m != 1', a, check(a));
log('ok!', b, check(b));
log("no 'd' key", c, check(c));
function log(comment, data, result) {
out.textContent += JSON.stringify({comment, data, result}, null, 2) + '\n';
}