diff --git a/lib/Symbols.js b/lib/Symbols.js index 1129e5be..48fd403c 100644 --- a/lib/Symbols.js +++ b/lib/Symbols.js @@ -19,7 +19,7 @@ Symbols.getSymbolsInExpression = function(expression) { }; // Iterates through a node and returns the last term with the symbol name -// Returns null if no terms with the symbol name are in the node. +// Returns undefined if no terms with the symbol name are in the node. // e.g. 4x^2 + 2x + y + 2 with `symbolName=x` would return 2x Symbols.getLastSymbolTerm = function(node, symbolName) { // First check if the node itself is a polyomial term with symbolName @@ -43,7 +43,7 @@ Symbols.getLastSymbolTerm = function(node, symbolName) { return Symbols.getLastSymbolTerm(node.content, symbolName); } - return null; + return undefined; }; // Iterates through a node and returns the last term that does not have the @@ -57,7 +57,7 @@ Symbols.getLastNonSymbolTerm = function(node, symbolName) { return new Node.PolynomialTerm(node).getCoeffNode(); } else if (hasDenominatorSymbol(node, symbolName)) { - return null; + return undefined; } else if (Node.Type.isOperator(node)) { for (let i = node.args.length - 1; i >= 0 ; i--) { @@ -71,7 +71,7 @@ Symbols.getLastNonSymbolTerm = function(node, symbolName) { } } - return null; + return undefined; }; // Iterates through a node and returns the denominator if it has a @@ -98,7 +98,7 @@ Symbols.getLastDenominatorWithSymbolTerm = function(node, symbolName) { } } } - return null; + return undefined; }; // Returns if `node` is a term with symbol `symbolName`