I know this question has been asked for many times, however, most of them are either for the Node.js solutions or does not work in the browsers.
So, is it possible to implement a private method in browser javascript class?
<html>
<body>
<script>
class Happy
{
constructor()
{
}
_leo()
{
console.log("ff");
}
}
var h=new Happy();
h._leo();
</script>
</body>
</html>
However, the above code still outputs "ff" in the console, how can I fix it?