DEV Community

Discussion on: 7 interesting deprecated JavaScript features

Collapse
 
miketalbot profile image
Mike Talbot ⭐

Great list, I didn't have a clue about some of those :)

One other way of doing a "with like thing" having a go at the C# syntax I've seen is this:


function scope(value, fn) {
    return fn(value)
}

const cat = {
    details: {
        passport: {
            location: {
                city: "New York"
            }
        }
    }
}

scope(cat.details.passport.location, _ => {
    _.city = "Meowyork"
})
Enter fullscreen mode Exit fullscreen mode
Collapse
 
stojakovic99 profile image
Nikola Stojaković

That's nice!