How do I work out how to address an object in order to prototype it?

I would like to prototype an object but the problem is, I don't know how to address the object before I use it.

??????.prototype.writeObj = function( obj ) { this.write( JSON.stringify(obj) ); } tls.createServer(options, function (s) { s.writeObj( {command:'addjob', options:{} } ); }

The important thing for me here is to find out how to go about finding this out, if that makes sense. I've tried reading the node documentation, but it does....oh hang on a sec.

I will continue anyway, turns out ????? is stream.Stream. Without reading the manual sic, is there an easy way to find this out in code?

--------------Solutions-------------

Object.getPrototypeOf

The ES5 method lets you find the prototype.

Object.getPrototypeOf(s) === stream.Stream

There is a similar utility method called .isPrototypeOf

stream.Stream.isPrototypeOf(s)

Category:javascript Time:2011-08-15 Views:1

Related post

  • How to get Shipping/Billing Address ID of an order outside Magento core API? 2010-08-30

    I want to get a shipping/billing address id from a just complete order out of Magento. I have tried the following code but it's not worked: Mage::getModel('sales/order')->load($array_data["order_id"])->getShippingAddressId() Does someone have a

  • Change MAC address Cocoa - Objective-C 2011-01-28

    How can I change the MAC address via Objective-C? Looking for a simple solution. I already have a shell script (Bash) that can do it if that helps. How would I open that from my Cocoa application? Thanks. --------------Solutions------------- You can

  • Addressing a Object-Function in an JavaScript Event-Handler 2012-02-13

    let's say I have a JavaScript-Class like this: Foo.prototype = { init: function() { $(document).keydown(function(event) { this.onKeyDown(event); }); } onKeyDown: function(event) { alert("bar"); } } myObj = new Foo(); myObj.init(); This Code won't wor

  • Is it best to store address information with the order table or in it's own table? 2012-02-18

    I am designing a database and initially I setup addresses separate from orders so the orders table just has a billing id and address id reference and the actual address are stored in the address table. However the more I think about this i am not sur

  • Which data structure to store addresses of objects in C++ 2012-03-18

    I am beginner in C++, I need to know which data structure to store addresses of objects in C++. Thanks --------------Solutions------------- A pointer. (and here's some SO padding :) You would need to use something called a "pointer." Normal variables

  • Outlook - how do I arrange my address book in alphabetical order 2013-07-23

    Outlook - how do I arrange my address book in alphabetical order --------------Solutions------------- Hi Kieran, Mention the type of email account configured in Outlook? By default the contacts in the Outlook Address book would be in alphabetical ord

  • in window mail in Vista , how do I arrange entries in address book in alphabetic order? 2014-03-11

    in windows mail in Vista , how do I arrange entries in address book in alphabetic order? --------------Solutions------------- Hello Caddyinolean, Thank you for posting. Windows Mail pulls the Contacts from Windows Contacts. Click on Start, All Progra

  • Returning the addresses of objects created outside the main() function 2009-03-03

    I am trying to create a link list, but I am having trouble creating objects inside a function and assigning pointers to their addresses, since I believe they go out of scope when the function exits. Is this true? And, if so, how can I create an objec

  • Avoid using InetAddress - Getting a raw IP address in network byte order 2010-05-02

    I am trying to use the MaxMind GeoLite Country database on the Google App Engine. However, I am having difficulty getting the Java API to work as it relies on the InetAddress class which is not available to use on the App Engine. However, I am not su

  • Getting street name from Address/Location object in Android 2010-11-23

    I'm trying to get the street name of my current location but I can't seem to get it. I use this method to retrieve the Address: public Address getAddressForLocation(Context context, Location location) throws IOException { if (location == null) { retu

  • Is there a python data structure that is: keyed, ordered, and addressable via key and order? 2011-04-19

    I'm looking for a data structure that's a mix of OrderedDict but also addressable via an integer, depending on when the element was added. i.e. config_key = OrderedDict([('Version_Number', 'a'), ('Hardware_Config', 'b'), ('Size_Of_Data', 'c'), ('Chec

  • How to pass address of objects created in a C# List to C++ dll? 2011-06-14

    I have been looking all over google to find some answers to my questions but do not quite understand what I have found. I have some objects which are created and stored in C# List after using System.IO to read some text files. After that, I want to s

  • Spring MVC 3 + Hibernate: Different Addresses of objects (once loaded via service, once via entity) 2011-06-22

    I have an Entity "Account" which has a ManyToMany Relationship to an Entity "Role". When I add a new "Account" via JSP Form everything works fine. I can choose there all the Roles I d like to associate with the Account via Checkboxes. If I now try to

  • What about memory address of objects in C++? 2011-07-07

    I am reading some C++ text and got the following code: From that code, in the main() function, the author use sizeof() to get the memory address of all object and its member functions. the results: From that results, the author made a diagram as foll

  • Getting the MAC Address in Objective-C 2011-07-19

    How do I get the MAC address of the computer in Objective-C? I was using the following code but it started crashing once I switched to using the LLVM compiler. Can anyone tell me how to fix this code or give me new code that works? I found a way to d

  • How to address the object that has been Clicked but not the children inside it? 2011-08-05

    inside a MouseEvent.CLICK function, I usually used e.target to address the movieClip that I clicked, but that only work with a movieClip that doesn't have any children (such as text and other symbols) inside. When it has children inside, the e.target

  • Store Address Details for Customers & Orders 2011-10-20

    I am struggling with the database design for storing customer address's and relating them to orders in an inventory system. Currently I have the following schema ideas and 3 options: Customers CustomerID CustomerName ..... CustomerAddress AddressID C

  • True address of object's method 2011-11-07

    I know that I can create method pointers, and I know that they are generally different than function pointers. Converting between them is not allowed. Method pointers can contain lots of data about how to adjust this pointer and so on. I would like t

  • Contact Address return object Parsing 2011-11-21

    I am using Titanium to develop an app, when I query for a contact address I get the following return. ( { City = Milano; Country = Italy; CountryCode = it; State = Lc; Street = "Via Donatori "; ZIP = 23835; } ) How do I parse through this? It's not a

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 1.483 (s). 13 q(s)