focusvasup.blogg.se

Mac cheat sheet pdf
Mac cheat sheet pdf







mac cheat sheet pdf

Var b = a.tolowercase(a) concat() joins two or more strings together into another string var a = “my name is” Var b = a.touppercase (a) tolowercase() changes all characters into lowercase var a = “hackr.io is nice website” Var b = a.replace(“nice”, “good”) touppercase() changes all characters into uppercase var a = “hackr.io is nice website” Var b = a.substr(13, 8) replace() replaces a particular value with another var a = “hackr.io is nice website” Var b = a.substring(0, 7) substr() returns the sliced out portion of a string, the second parameter being the length of the final string. cannot take negative values unlike slice() var a = “hackr.io is nice website”

mac cheat sheet pdf

substring() substring returns part of the string from start index to the end index specified.

mac cheat sheet pdf

Var b = a.slice(13) will return nice website. Var b = a.indexof(“nice”, 6) search() searches and returns position of a specified value in string var a = “hackr.io is nice website” var b = a.search(“nice”) slice() extracts and returns part of a string as another new string var a = “hackr.io is nice website” Var b = a.indexof(“nice”) lastindexof() returns last occurrence of text in a string var a = “hackr.io is nice website” Eg, function add(a, b) String Methods Method Meaning Example length determines length of string var a = “hackr.io” Ī.length indexof() finds position of the first occurrence of a character or text in the string var a = “hackr.io is nice website” join() Joins all the elements of one array as a string indexof() Returns the index (first position) of an element in the array lastindexof() Returns the last position of an element in the array sort() Alphabetic sort of array elements reverse() Sort elements in descending order valueof() Primitive value of the element specified slice() Cut a portion of one array and put it in a new array splice() Add elements to an array in a specific manner and position unshift() Add new element to the array in the beginning shift() Remove first element of the array pop() Remove the last element of the array push() Add new element to the array as the last one tostring() Prints the string value of the elements of the array Operators BasicĪ group of tasks can be performed in a single function. Eg, var subjectlist = Arrays can perform the following functions: Functions Description concat() Concatenate different arrays into one. var student = Objects Contains single object of various data types – Eg, var student = ArraysĪrrays group similar kinds of data together.

  • let – can be used only within the block its declared, can be reassigned Data types Can be of different types –.
  • can be accessed within the function where declared. Comments Single-line Multiple-line There are two types of comments: // this is a single line comment /* this is a multiple line comment when you have to write a lot of things */ Variables – values that hold data to perform calculations or other operations

    #Mac cheat sheet pdf code

    To include javascript code on a page, the syntax is – Here you can go with the quick guide or JS cheat sheet which will help you to know more about shortcuts and tricks: Usually, JavaScript functions are involved when a client does an action, for example, submitting a form, hovering the mouse, scroll etc… Web pages are more lively, dynamic and interactive due to the presence of JS code. Javascript is a client-side scripting language supported by browsers.









    Mac cheat sheet pdf