Declaring Literal Objects in C#

Here’s an awesome blog post on how to declare literal objects and object arrays in C#. My example involved calling a method within my C# custom workflow activity class: protected override void Execute(CodeActivityContext executionContext) { . . . dynamic[] sendFields = { new { type = "TO", teamMembers = GetTeamMembers(service, …

How to Get the Name of an Instance of a Class in Javascript

I was using JSONP (note that I prefer CORS but this was a special case where CORS wasn’t possible) and wanted an object that needed to call a method within itself. As you know, JSONP involves adding a script tag to the DOM which will return the JSON data encapsulated …

Javascript Object Class Literal vs. Constructor

Something I dug up while learning Javascript a long, long while ago. Here’s is an interesting article on the differences between a literal class declaration and a constructor. Essentially, the main difference is that with a literal class declaration, the object itself as well as its properties and methods are …

Create an Extensible Object in Javascript

There’s a whole mess of ways to accomplish this (see this article). Obviously, YMMV, but I chose this route for one simple reason: it makes sense to me. Anyhow, here’s a method of creating an extensible object in Javascript. var theObject = function (config) {   this.exProperty = “”;   this.exFunction = …