The document provides biographical information about Viktor Turskyi, including his professional experience as a non-executive director, founder, senior software engineer, and open source developer with over 20 years of experience in IT. It also lists some of his conference talks and delivered projects. The remaining slides provide examples and explanations of JavaScript and Perl concepts like data types, operators, functions, objects and arrays.
2. Viktor Turskyi
● Non-executive Director at WebbyLab
● Founder at my-talks.net
● Senior Software Engineer at Google
● Open source developer
● More than 50 conference talks
● 20 years of experience in IT
● Delivered more than 80 projects of different
scale (including projects for 5 companies from
Fortune 500 list)
2/36
15. Increment variable by 10000
Set variable to 10000 if contains falsy value, otherwise leave as is
Set variable to 10000 if it is node defined
Case 1: Logical assignment
15/36
27. Sort array numerically
Sort array by value length (longest first), if the length is equal then
sort alphabetically (a to z)
Case 5: Sort array
27/36
28. JavaScript solution
const numbers = [10, 4, 3, 9, 8];
const sorted = numbers.sort((a,b) => a - b);
const words = ['cat', 'dog', 'cow', 'parrot', 'camel'];
const localCmp = (a, b) => {
// Ternary operator will make sorting "unstable"
if (a > b) {
return 1;
} else if (a < b) {
return -1;
} else {
return 0;
}
};
const sortedWords = words.sort((a, b) => {
return b.length - a.length || localCmp(a, b);
});