How can I copy object data in the browser's console?

how to copy console.log objects in a browser?

as we can see, this data is an object, and it looks like this after expansion.
how can I copy data?

copy data like this instead of copying value alone:

{
  id:1,
  name:"01",
   img:"http://localhost:8000/media/images/qiyun_admin_websitemanage/logo/logo_01.png",
  type: "LOGO"
}
Feb.27,2021

copy (obj) ?


can be copied by converting it to a JSON string.

console.log(JSON.stringify(obj))

console. Dir (obj)


enumerable and not at the beginning of an underscore.

let result = {};
for ( let k in obj2 ) {
  k[0] !== '_' && ( result[ k ] = obj2[ k ] );
};
console.log( result );

maybe you're thinking too much. The landlord just wants to copy

like Ctrl+c.
Menu