VBA->JS: Data type properties and methods (Concept)

VBA provides useful functions for working with variables of the data types String, Number and (to a lesser extent) Boolean. For example, if you need information from a String you can use Len(), Left(), Mid() and Right() to determine the number of characters in the string, the characters counting from the beginning of the String, from any given position in the String or from the end (right) of the String, respectively.

JavaScript provides much of the same information, sometimes in the form of properties, sometimes in the form of methods (like VBA functions). The names are different from what we’re familiar with in VBA, but the functionality is all there, with some nice additions we’ve sometimes wished for!

Rather than going into detail here and repeating information available elsewhere, following are links to information JavaScript provides for the various data types. If something should be unclear and you’d like more information, post a Comment.
Strings:
http://www.w3schools.com/jsref/jsref_obj_string.asp
http://www.w3schools.com/js/js_string_methods.asp

Numbers:
http://www.w3schools.com/js/js_numbers.asp
http://www.w3schools.com/js/js_number_methods.asp
http://www.w3schools.com/jsref/jsref_obj_number.asp
http://www.w3schools.com/js/js_math.asp

Boolean:
http://www.w3schools.com/jsref/jsref_obj_boolean.asp

Objects can also have properties and methods, but the developer defines these, they aren’t built into JavaScript.
http://www.w3schools.com/js/js_objects.asp



Leave a Reply