Please refer to the image attached.
This is my first node app/script and I am trying to understand why I am getting different results when I attach .then(console.log):
at the end vs. when I just use console.log(list);
.
https://i.stack.imgur.com/FnOLv.jpg
In case the image doesn't load here is the snippet
// Generate list
const list = r.getSubreddit('AskReddit')
.getTop({ time: 'all', limit: 1 })
.map(post => ({
title: post.title,
url: post.url,
upvotes: post.ups
}))
.then(console.log);
// console.log(list);
I get this error message:
internal/util/inspect.js:373
const symbols = Object.getOwnPropertySymbols(value);
^
TypeError: 'ownKeys' on proxy: trap result did not include 'prototype'
at Function.getOwnPropertySymbols (<anonymous>)
at getKeys (internal/util/inspect.js:373:26)
at formatRaw (internal/util/inspect.js:617:12)
at formatValue (internal/util/inspect.js:540:10)
at inspect (internal/util/inspect.js:197:10)
at Object.formatWithOptions (util.js:84:12)
at Console.(anonymous function) (internal/console/constructor.js:274:15)
at Console.log (internal/console/constructor.js:284:61)
at Object.<anonymous> (/Users/ik/Documents/Personal/list.js:27:9)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)
at internal/main/run_main_module.js:21:11