Our website uses cookies to enhance your browsing experience.
Accept
to the top

Webinar: Let's make a programming language. Lexer - 29.04

>
>
>
V7010. Return value of the function...
menu mobile close menu
Additional information
toggle menu Contents

V7010. Return value of the function is required to be utilized.

Apr 03 2026

The analyzer has detected a suspicious method call, the return value of which is ignored. Calling some methods without using their return values is pointless.

The example:

/**
 * @param {string} input
 * @returns {string}
 */
function escape(input) {
  input.replaceAll(";", "\\;")
  input.replaceAll(",", "\\,")
  return input
}

In this case, the replaceAll method is called, but the call result is ignored. The replaceAll method returns a new string without modifying the original one on which the method was called. As a result, the string containing the necessary modification is not used.

For the modifications to take effect, save the result:

/**
 * @param {string} input
 * @returns {string}
 */
function escape(input) {
  input = input.replaceAll(";", "\\;")
  input = input.replaceAll(",", "\\,")
  return input
}