Message from JavaScript discussions

April 2018

— ?

— 

const obj = { prop: {} };
const { prop } = obj;

const nameOfProp = Object.entries(obj)
.find(x => x[1] === prop)[0];


If I want to find the key that was used for prop in obj, I would use this method, nameOfProp would then contain "prop"

— Oh i see

— But if you just have:
const myVar = 4;

You can't get the name "myVar" out of it
(UNLESS it's a function)

Message permanent page

— 😱

— 

const myVar = function () {};

// this works:
myVar.name

— Works for arrow functions too

— Thanks thomas for your answer 👌

— Np

— Http://cvl-demos.cs.nott.ac.uk/vrn/

— I love JavaScript, I really do

— Hi every body . is javascript is good for accounting calculations ?