There is a string
var str = "key1.key2.key3"; There is an object
var obj = { key1: { key2: { key3: false } } } You need to get to the key in obj.key1.key2.key3 from the keys indicated in the row through a dot and change the value to another.
Variant of the answer for old browsers:
str = str.split("."); var strLng = str.length; var tmp = obj; for(var strIdx = 0; strIdx < strLng; strIdx++) { if(strIdx < strLng - 1) { tmp = tmp[str[strIdx]]; } else { tmp[str[strIdx]] = true; } }