Skip to content

Commit

Permalink
Update 04.super关键字调用父类普通函数.html
Browse files Browse the repository at this point in the history
  • Loading branch information
zh1375543 authored Apr 15, 2024
1 parent 7b8de0d commit c861695
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</html>
<script>
//super 关键字调用父类普通方法
// 若父类和子类含有相同的函数,则会应用就近原则,优先调用子类的函数(类似于java重写)
class Father {
constructor() {

Expand All @@ -31,5 +32,5 @@
var son = new Son()
son.say()

// 若父类和子类含有相同的函数,则会应用就近原则,优先调用子类的函数

</script>

0 comments on commit c861695

Please sign in to comment.