We recommend using Visual Studio 2017

<deprecated> (JavaScript)


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Visual Studio 2017 Documentation. Specifies a deprecated function or method.



Optional. Specifies whether the function or method will be removed in a future release, or whether the function or method has already been removed and that its use may result in an error. Set to deprecate to specify that the function or method will be removed in a future release. Set to remove to specify that the function or method has already been removed.

Optional. The identifier for localization information about the function or method. The identifier is either a member ID or it corresponds to the name attribute value in a message bundle defined by OpenAjax metadata. The identifier type depends on the format specified in the <loc> element.

Optional. A description of the function or method that is being deprecated.

The elements used to annotate functions, which include <deprecated>, must be placed in the function body before any statements. When you mark a function as deprecated, we recommend that you replace its <summary> element with the <deprecated> element.

The following code shows how to use the <deprecated> element.

function areaFunction(radiusParam) {  
    /// <deprecated type="deprecate" >Determines the area of a circle when supplied a radius parameter.</deprecated>  
    /// <param name="radiusParam" type="Number">The radius of the circle.</param>  
    /// <returns type="Number">The area.</returns>  
    var areaVal;  
    areaVal = Math.PI * radiusParam * radiusParam;  
    return areaVal;  

XML Documentation Comments