/// Creates a host variable of the specified type.
/// </summary>
/// <typeparam name="T">The type of variable to create.</typeparam>
/// <param name="initValue">An optional initial value for the variable.</param>
/// <returns>A new host variable of the specified type.</returns>
/// <remarks>
/// <para>
/// A host variable is a strongly typed object that holds a value of the specified type.
/// Host variables are useful for passing method arguments by reference. In addition to
/// being generally interchangeable with their stored values, host variables support the
/// following properties:
/// </para>
/// <para>
/// <list type="table">
/// <listheader>
/// <term>Property</term>
/// <term>Access</term>
/// <description>Description</description>
/// </listheader>
/// <item>
/// <term><c>value</c></term>
/// <term>read-write</term>
/// <description>The current value of the host variable.</description>
/// </item>
/// <item>
/// <term><c>out</c></term>
/// <term>read-only</term>
/// <description>A reference to the host variable that can be passed as an <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier">out</see></c> argument.</description>
/// </item>
/// <item>
/// <term><c>ref</c></term>
/// <term>read-only</term>
/// <description>A reference to the host variable that can be passed as a <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref">ref</see></c> argument.</description>
/// </item>
/// </list>
/// </para>
/// </remarks>
/// <example>
/// The following code demonstrates using a host variable to invoke a method with an
/// <c>out</c> parameter.
/// It assumes that an instance of <see cref="ExtendedHostFunctions"/> is exposed under
/// the name "host"
/// (see <see cref="ScriptEngine.AddHostObject(string, object)">AddHostObject</see>).
/// <code lang="JavaScript">
/// // import a dictionary type
/// var StringT = host.type("System.String");
/// var StringDictT = host.type("System.Collections.Generic.Dictionary", StringT, StringT);
/// // create and populate a dictionary
/// var dict = host.newObj(StringDictT);
/// dict.Add("foo", "bar");
/// dict.Add("baz", "qux");
/// // look up a dictionary entry
/// var result = host.newVar(StringT);
/// var found = dict.TryGetValue("baz", result.out);