Does js have htmlspecialchars and htmlspecialchars_decode functions similar to php?

$x= "

test

"; echo htmlspecialchars($x);

test

$y = htmlspecialchars($x); php > echo htmlspecialchars_decode($y);

test

There doesn"t seem to be a ready-made function in

js, is it?
htmlspecialchars and htmlspecialchars_decode?

Jul.22,2021

doesn't seem to have it, but you can do it in the browser

function encode(s) {
    const div = document.createElement("div");
    div.innerText = s;
    return div.innerHTML; 
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d465-2c389.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d465-2c389.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?