JSFiddle - React, Tailwind, and code Playground

by David Santiago

JavaScript

const entries = [
  { id: '2', type: 'userid' },
  { id: '135', type: 'userid' },
  { id: '166', type: 'userid' },
  { id: '283', type: 'userid' }
];

const map = {
    RequestItems: {
      "table": {
        Keys: entries.map((entry) => ({
          entityId: entry.id,
          entityType: entry.type,
        })),
      },
    },
  };
  console.log("param", map);
  console.log("param", {
        Keys: entries.map((entry) => ({
          entityId: {S:entry.id},
          entityType:{S: entry.type},
        })),
      });