Posts

Showing posts from February 7, 2019

Travancore

Image
.mw-parser-output .avviso .mbox-text-div>div,.mw-parser-output .avviso .mbox-text-full-div>div{font-size:90%}.mw-parser-output .avviso .mbox-image div{width:52px}.mw-parser-output .avviso .mbox-text-full-div .hide-when-compact{display:block} Questa voce o sezione sull'argomento India è ritenuta da controllare . Motivo : Nomenclatura discordante: la voce è Travancore, mentre la categoria è Categoria:Regno di Travancore. Per coerenza, voce e categoria dovrebbero avere lo stesso titolo. Quale dei due? Partecipa alla discussione e/o correggi la voce. Regno di Travancore Dati amministrativi Nome ufficiale തിരുവിതാംകൂര്‍; Kingdom of Travancore Lingue parlate indiano, inglese Capitale Trivandrum poi Padmanabhapuram Dipendente da Regno Unito dal 1858 al 1947 India dal 1947 al 1949 Politica Forma di governo regno Nascita 1102 Fine 1949 con Sree Chithira Thirunal Balarama Varma Territorio e popolazione Economia Valu

Get string representation of object path

Image
1 1 Say I have a situation like this: const foo = { bar: { star: { guitar: 'geetar' } } } and then I have: const stew = { moo: () => foo.bar.star.guitar } then I call moo in the next tick of the event loop: process.nextTick(function(){ const guitar = stew.moo(); }); my question is - is there any way/trick to get the string representation of the path: "foo.bar.star.guitar"? I could replace the code with a string: const stew = { moo: () => 'foo.bar.star.guitar' } but I am looking to find a way to get a string representation. One important detail is that I want to generate a useful error message - if someone puts in an object path that doesn't exist. That is the whole purpose of getting a string represe