이 페이지에서

표현식에 무효를 사용하지 마세요.

이 경고 범주의 철자는 [void] 입니다.

무효 표현식을 사용하지 마십시오.

무슨 일이 일어났나요?

JavaScript void 표현식이 사용되었습니다.

이것이 왜 나쁜가요?

void 표현식은 대부분 중복되어 반환되는 값을 숨겨 일부 코드의 논리를 모호하게 만들 수 있습니다. 또한 명확하지 않고 읽기 어렵다는 이유로 많은 코드 스타일에서 금지되어 있습니다.

예시

import QtQuick

Item {
    function undef() {
        return void 0
    }

    function f() {
        return void someFunction()
    }
}

이 경고를 수정하려면 void 사용을 제거하거나 대체하세요:

import QtQuick

Item {
    function undef() {
        return undefined
    }

    function f() {
        somefunction()
    }
}

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.