Last active
February 8, 2021 23:03
-
-
Save cphoover/fa5f9937d45792fdb82aad437cd332bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var locationURL = new URL('https://www.google.com/search?q=test') | |
var props = []; | |
for (var prop in locationURL) props.push(prop); | |
var locationObj = {}; | |
props.forEach(prop => { | |
Object.defineProperty(locationObj, prop, { | |
get : () => locationURL[prop], | |
set : (val) => locationURL[prop] = val | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment