What is Traits?
- Code is shortened by using Traits.
- One code is used everywhere just by writing the trait function.
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Restrictions on properties and methods.
class school {
}
class students extends school {
}
$sch =new school (); // only use class school
$stu = new students (); // use both class school students (properties and methods)
Constructor is a special type of function of a class which is automatically executed when object of that class is created. Constructor is also called as magic function because in php constructor is start usually with two underscore characters. It saves lot of time on big project.
function __constructor(){
body part;
}
Example of javaScript using inside html between body tag.
Example to use javaScript between head tag in html.
We can create external JavaScript file and embed it in many html page. If you want to run the same JavaScript on several pages in a web site, you should create an external JavaScript file, instead of writing the same script over and over again.
There are following features of js :-
JavaScript is used to create interactive websites. It is mainly used for:
Hello JavaScript by JavaScript