Is there any method for when been called an object it returns a field of that object?
function Int16(v) { this.v=v }; var n = new Int16(10);
// Instead of "n.v", I would want to use "n" directly
if (n.v == 10) { console.log("ok") }
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
var n = new Int16(10);will setnto a reference to an object of yourInt16type.What you’re looking for may be to set the
valueOfandtoStringfunctions to return the value ofv.