Table Of Contents

JavaScript Reference Functionality

Last Modified: November 16, 2020

JavaScript references behave similarly to references for other data types, but have some unique functionality.

When using JavaScript references in your web application, you need to consider the following:
  • Primitive values null and undefined—JavaScript references treat primitive values null and undefined the same as other primitives, such as strings, booleans, numbers, etc. If a value of null or undefined is returned, it generates a new JavaScript reference that you need to clean up to prevent memory leaks.
  • Not a Number/Path/Refnum? behavior—The node tells you if the value is valid, but it does not tell you if the JavaScript reference value is null or undefined. There is not an existing node to check for values of null or undefined.
  • JavaScript values—JavaScript references can hold any JavaScript value, including primitives and objects, such as JavaScript functions, HTML elements, and class instances.
  • Type definitions containing a JavaScript reference—JavaScript references do not have front panel representations, so you will need to use the following process to create a type definition containing a JavaScript reference:
    1. Create a VI (.gvi) with a web server target in your web application project.
    2. Add your JavaScript reference to the diagram.
    3. In the Configuration pane, click Change to Type Definition.

Recently Viewed Topics