var person = {
firstName: "John",
lastName: "Doe",
age: 50,
eyeColor: "blue"
};
objectName.propertyName
// nebo
objectName["propertyName"]
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
fullName : function() {
return this.firstName + " " + this.lastName;
}
}
//objectName.methodName();
name = person.fullName();
var patt = /w3schools/i;
var str = "Visit W3Schools";
var n = str.search(/w3schools/i);
// výsledek: 6
var str = "Visit Microsoft!";
var res = str.replace(/microsoft/i, "W3Schools");
// Visit W3Schools!
Click on this text!
Mouse Over Me
Click Me
A function is triggered when the user is pressing a key in the input field.