javascript - Underscore extend with dot.notation quotes are removed, How to get it with quotes? -
here example:
var 1 = {test: 'test'}; var 2 = {'test.test': 'test inside test'}; console.log(_.extend(one, two))
the extended object return test.test: 'test inside test'
bad me because i'm looking use mongodb , need make sure it's 'test.test'
quotes. way return or super simple solution add quotes?
make single-quote part of string using double-quote around or escaping second inner-set of single quotes.
var 2 = {"'test.test'": 'test inside test'};
or:
var 2 = {'\'test.test\'': 'test inside test'};
Comments
Post a Comment