I'm new to JavaScript and learning it for a week now. I had applied for an internship in different companies and I was called yesterday for an interview. They asked me some questions and for this one particular question, I had no clue. Can someone provide me the solution or help me clarify this proxy topic.
What is the solution to this Question?
Please write a simple log function that will proxy a string argument to console.log() *
Proxyis basically a something that intercepts an interaction with an underlying function or property and adds some extra logic to the underlying function or property before invoking/changing/returning that value to the caller. This question is quite ambiguous and more explanation is required for a better answer. You should have asked follow up questions regarding this.