\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Exalys (Exalys)} \pdfinfo{ /Title (javascript-base.pdf) /Creator (Cheatography) /Author (Exalys (Exalys)) /Subject (Javascript Base Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{2077E8} \definecolor{LightBackground}{HTML}{F1F6FD} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Javascript Base Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Exalys (Exalys)} via \textcolor{DarkBackground}{\uline{cheatography.com/143213/cs/30776/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Exalys (Exalys) \\ \uline{cheatography.com/exalys} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 6th February, 2022.\\ Updated 6th February, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{x{12.7798 cm} x{4.4902 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{String}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Properties}}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`constructor`} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`lenght`} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`prototype`} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Methods \& returned type}}`} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{\seqsplit{`String.fromCharCode(num1} {[}, ...{[},numN{]}{]})`} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{\seqsplit{`String.fromCodePoint(num1} {[}, ...{[},numN{]}{]})`} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`String.raw()`} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} `str.charAt(index)` & `{\emph{new string}}` \tn % Row Count 10 (+ 2) % Row 9 \SetRowColor{white} `str.charCodeAt(index)` & `{\emph{number}}` \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} \seqsplit{`str.codePointAt(position)`} & `{\emph{number}}` \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} `str.concat(string2{[}, string3, ..., stringN{]})` & `{\emph{new string}}` \tn % Row Count 14 (+ 2) % Row 12 \SetRowColor{LightBackground} `str.includes(searchTerm, position);` & `{\emph{boolean}}` \tn % Row Count 16 (+ 2) % Row 13 \SetRowColor{white} `str.indexOf(searchValue, fromIndex)` & `{\emph{index}}` \tn % Row Count 18 (+ 2) % Row 14 \SetRowColor{LightBackground} `str.lastIndexOf(searchValue{[}, fromIndex{]})` & `{\emph{index}}` \tn % Row Count 20 (+ 2) % Row 15 \SetRowColor{white} `str.search(regexp)` & `{\emph{string}}` \tn % Row Count 21 (+ 1) % Row 16 \SetRowColor{LightBackground} `str.match(regexp)` & `{\emph{array}}` \tn % Row Count 22 (+ 1) % Row 17 \SetRowColor{white} `str.matchAll(regexp)` & `{\emph{array}}` \tn % Row Count 23 (+ 1) % Row 18 \SetRowColor{LightBackground} \seqsplit{`str.padStart(targetLenght} {[}, padString{]})` & `{\emph{string}}` \tn % Row Count 25 (+ 2) % Row 19 \SetRowColor{white} `str.padEnd(targetLengh t{[}, padString{]})` & `{\emph{string}}` \tn % Row Count 27 (+ 2) % Row 20 \SetRowColor{LightBackground} `str.repeat(count)` & `{\emph{string}}` \tn % Row Count 28 (+ 1) % Row 21 \SetRowColor{white} `str.trim()` & `{\emph{string}}` \tn % Row Count 29 (+ 1) % Row 22 \SetRowColor{LightBackground} `str.trimStart()` & `{\emph{string}}` \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{12.7798 cm} x{4.4902 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{String (cont)}} \tn % Row 23 \SetRowColor{LightBackground} `str.trimEnd()` & `{\emph{string}}` \tn % Row Count 1 (+ 1) % Row 24 \SetRowColor{white} `str.replace(searchFor, replaceWith)` & `{\emph{new string}}` \tn % Row Count 3 (+ 2) % Row 25 \SetRowColor{LightBackground} ` str.replaceAll(searchFor, replaceWith)` & `{\emph{new string}}` \tn % Row Count 5 (+ 2) % Row 26 \SetRowColor{white} `str.slice(beginIndex{[}, endIndex{]})` & `{\emph{new string}}` \tn % Row Count 7 (+ 2) % Row 27 \SetRowColor{LightBackground} `str.substring(indexStart{[}, indexEnd{]})` & `{\emph{string}}` \tn % Row Count 9 (+ 2) % Row 28 \SetRowColor{white} `str.split({[}separator{[}, limit{]}{]})` & `{\emph{array}}` \tn % Row Count 11 (+ 2) % Row 29 \SetRowColor{LightBackground} \seqsplit{`str.startsWith(searchStr} {[}, position{]});` & `{\emph{boolean}}` \tn % Row Count 13 (+ 2) % Row 30 \SetRowColor{white} `str.endsWith(searchStr{[}, position{]});` & `{\emph{boolean}}` \tn % Row Count 15 (+ 2) % Row 31 \SetRowColor{LightBackground} `str.toLowerCase()` & `{\emph{string}}` \tn % Row Count 16 (+ 1) % Row 32 \SetRowColor{white} `str.toUpperCase()` & `{\emph{string}}` \tn % Row Count 17 (+ 1) % Row 33 \SetRowColor{LightBackground} \seqsplit{`str.toLocaleLowerCase()`} & `{\emph{string}}` \tn % Row Count 18 (+ 1) % Row 34 \SetRowColor{white} \seqsplit{`str.toLocaleUpperCase()`} & `{\emph{string}}` \tn % Row Count 19 (+ 1) % Row 35 \SetRowColor{LightBackground} `str.valueOf()` & `{\emph{primitive}}` \tn % Row Count 21 (+ 2) % Row 36 \SetRowColor{white} `str.localeCompare(strToCompare{[},locales{[}, options{]}{]})` & `{\emph{1 || 0}}` \tn % Row Count 23 (+ 2) % Row 37 \SetRowColor{LightBackground} `str.normalize({[}form{]});` & `{\emph{string}}` \tn % Row Count 24 (+ 1) % Row 38 \SetRowColor{white} `toString` & \seqsplit{`convertion`} \tn % Row Count 26 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{11.9163 cm} x{5.3537 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{7 booleans \{false\}}} \tn % Row 0 \SetRowColor{LightBackground} `boolean(0);` & `{\emph{false}}` \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `Boolean(-0)` & `{\emph{false}}` \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `(Boolean(null)` & `{\emph{false}}` \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `Boolean(false)` & `{\emph{false}}` \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `Boolean(NaN)` & `{\emph{false}}` \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `Boolean(undefined)` & `{\emph{false}}` \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `Boolean("")` & `{\emph{false}}` \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{12.9525 cm} x{4.3175 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Array}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Properties}}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`lenght`} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`constructor`} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`prototype`} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Methods \& returned value}}`} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `Array.from(arrayLike\{\{nl\}\} {[}, fonctionMap{[}, thisArg{]}{]})` & `{\emph{new array}}` \tn % Row Count 7 (+ 2) % Row 6 \SetRowColor{LightBackground} `Array.isArray(value)` & `{\emph{boolean}}` \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} `Array.of(item0{[}, item1{[}, ...{[}, itemN{]}{]}{]})` & `{\emph{new array}}` \tn % Row Count 11 (+ 2) % Row 8 \SetRowColor{LightBackground} `concat(value0, value1, ... , valueN)` & `{\emph{new array}}` \tn % Row Count 13 (+ 2) % Row 9 \SetRowColor{white} `push(item0, item1, /{\emph{ ... ,}}/ itemN)` & `{\emph{number}}` \tn % Row Count 15 (+ 2) % Row 10 \SetRowColor{LightBackground} `pop()` & `{\emph{string}}` \tn % Row Count 16 (+ 1) % Row 11 \SetRowColor{white} `shift()` & `{\emph{number}}` \tn % Row Count 17 (+ 1) % Row 12 \SetRowColor{LightBackground} `unshift(item0, item1, /{\emph{ ... ,}}/ itemN)` & `{\emph{number}}` \tn % Row Count 19 (+ 2) % Row 13 \SetRowColor{white} `reverse()` & `{\emph{array}}` \tn % Row Count 20 (+ 1) % Row 14 \SetRowColor{LightBackground} `slice(strat, end)` & `{\emph{array}}` \tn % Row Count 21 (+ 1) % Row 15 \SetRowColor{white} `splice(start, deleteCount, item1, item2, itemN)` & `{\emph{array}}` \tn % Row Count 23 (+ 2) % Row 16 \SetRowColor{LightBackground} `join(separator)` & `{\emph{string}}` \tn % Row Count 24 (+ 1) % Row 17 \SetRowColor{white} `includes(searchElement, fromIndex)` & `{\emph{boolean}}` \tn % Row Count 26 (+ 2) % Row 18 \SetRowColor{LightBackground} `find((element, index, array) =\textgreater{} \{ ... \} )` & `{\emph{index}}` \tn % Row Count 28 (+ 2) % Row 19 \SetRowColor{white} `findIndex((item, index, array) =\textgreater{} \{ ... \} )` & `{\emph{index}}` \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{12.9525 cm} x{4.3175 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Array (cont)}} \tn % Row 20 \SetRowColor{LightBackground} `indexOf(searchElement, fromIndex)` & `{\emph{index}}` \tn % Row Count 2 (+ 2) % Row 21 \SetRowColor{white} \seqsplit{`lastIndexOf(searchElement}, fromIndex)` & `{\emph{index}}` \tn % Row Count 4 (+ 2) % Row 22 \SetRowColor{LightBackground} `copyWithin(target, start, end)` & `{\emph{array}}` \tn % Row Count 6 (+ 2) % Row 23 \SetRowColor{white} `fill(value, start, end)` & `{\emph{array}}` \tn % Row Count 7 (+ 1) % Row 24 \SetRowColor{LightBackground} `entries()` & `{\emph{new array}}` \tn % Row Count 9 (+ 2) % Row 25 \SetRowColor{white} `keys()` & `{\emph{new array}}` \tn % Row Count 11 (+ 2) % Row 26 \SetRowColor{LightBackground} `values()` & `{\emph{new array}}` \tn % Row Count 13 (+ 2) % Row 27 \SetRowColor{white} `forEach(callback, thisArg)` & `{\emph{string}}` \tn % Row Count 14 (+ 1) % Row 28 \SetRowColor{LightBackground} `map(callback {[}, thisArg{]})` & `{\emph{new array}}` \tn % Row Count 16 (+ 2) % Row 29 \SetRowColor{white} `filter(callback, thisArg);` & `{\emph{new array}}` \tn % Row Count 18 (+ 2) % Row 30 \SetRowColor{LightBackground} `reduce(callbackFn, initialValue)` & `{\emph{value}}` \tn % Row Count 20 (+ 2) % Row 31 \SetRowColor{white} `reduceRight(callbackFn, initialValue)` & `{\emph{value}}` \tn % Row Count 22 (+ 2) % Row 32 \SetRowColor{LightBackground} `some(callback{[}, objetThis{]})` & `{\emph{boolean}}` \tn % Row Count 24 (+ 2) % Row 33 \SetRowColor{white} `every(callback{[}, thisArg{]})` & `{\emph{boolean}}` \tn % Row Count 26 (+ 2) % Row 34 \SetRowColor{LightBackground} \seqsplit{`sort(fonctionComparaison)`} & `{\emph{object}}` \tn % Row Count 27 (+ 1) % Row 35 \SetRowColor{white} `flat(depth)` & `{\emph{new array}}` \tn % Row Count 29 (+ 2) % Row 36 \SetRowColor{LightBackground} `flatMap(function)` & `{\emph{new array}}` \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{12.9525 cm} x{4.3175 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Array (cont)}} \tn % Row 37 \SetRowColor{LightBackground} `toString()` & `{\emph{string}}` \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Opérateur}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateurs logiques}}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`\&\& AND, || OR, ! NOT`} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateurs de comparaison}}`} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`==, ===, =!, ==!, \textgreater{}, \textgreater{}, =, \textless{}, \textless{}=`} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateurs arithmétiques}}`} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`+, -, {\emph{, /, \%, }}*`} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateurs d'affectation}}`} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`+=, -=, {\emph{=, /=, \%=, }}*`} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Incrémentation Décrémentation}}`} \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`i++, ++i, i-{}-, -{}-i`} \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateur ternaire}}`} \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`condition ? val1(true) : val2(false);`} \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateurs unaires}}`} \tn % Row Count 13 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`delete, typeof, void, +, -, \textasciitilde{}, !`} \tn % Row Count 14 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{Opérateurs relationnels}}`} \tn % Row Count 15 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`in, instanceof`} \tn % Row Count 16 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{9.6712 cm} x{7.5988 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Number}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Properties}}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `Number.MIN\_VALUE` & \seqsplit{`Number.MAX\_VALUE`} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{`Number.MIN\_SAFE\_INTERGER`} & \seqsplit{`Number.MAX\_SAFE\_INTERGER`} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} `Number.NaN` & `EPSILON` \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} `NEGATIVE\_INFINITY` & \seqsplit{`POSITIVE\_INFINITY`} \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Methods \& returned type}}`} \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} `Number.isNaN()` & `{\emph{boolean}}` \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} `Number.isFinite()` & `{\emph{boolean}}` \tn % Row Count 11 (+ 1) % Row 8 \SetRowColor{LightBackground} `Number.isInteger()` & `{\emph{boolean}}` \tn % Row Count 12 (+ 1) % Row 9 \SetRowColor{white} \seqsplit{`Number.isSafeInteger()`} & `{\emph{boolean}}` \tn % Row Count 14 (+ 2) % Row 10 \SetRowColor{LightBackground} \seqsplit{`Number.parseFloat(string)`} & `{\emph{number}}` \tn % Row Count 16 (+ 2) % Row 11 \SetRowColor{white} \seqsplit{`Number.parseInt(string}, {[}base{]})` & `{\emph{number}}` \tn % Row Count 18 (+ 2) % Row 12 \SetRowColor{LightBackground} \seqsplit{`toExponential(fractionDigits)`} & `{\emph{string}}` \tn % Row Count 20 (+ 2) % Row 13 \SetRowColor{white} `toFixed(digits)` & `{\emph{number}}` \tn % Row Count 21 (+ 1) % Row 14 \SetRowColor{LightBackground} \seqsplit{`toPrecision(precision)`} & `{\emph{string}}` \tn % Row Count 23 (+ 2) % Row 15 \SetRowColor{white} `toString({[}radix{]})` & `{\emph{string}}` \tn % Row Count 24 (+ 1) % Row 16 \SetRowColor{LightBackground} `valueOf()` & `{\emph{number}}` \tn % Row Count 25 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.3537 cm} x{11.9163 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Math object}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{`Math.round()`} & `Arrondi à l'entier le plus proche` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{`Math.floor()`} & `Arrondi à l'entier inférieur` \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{`Math.ceil()`} & `Arrondi à l'entier supérieur` \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{`Math.min()`} & `Renvoie le plus petit nombre` \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{`Math.max()`} & `Renvoie le plus grand nombre` \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \seqsplit{`Math.sign()`} & `Renvoie le signe d'un nombre` \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{`Math.abs()`} & `Renvoie le valeur absolue` \tn % Row Count 13 (+ 1) % Row 7 \SetRowColor{white} \seqsplit{`Math.sqrt()`} & `Renvoie le racine carrée ` \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} `Math.pow(x, y)` & `Renvoie le puissance` \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} `Math.log` & `Renvoie le logarithme` \tn % Row Count 18 (+ 1) % Row 10 \SetRowColor{LightBackground} \seqsplit{`Math.random`} & `Renvoie un nombre aléatoire ` \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{7.5988 cm} x{9.6712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Regexp}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Pattern Modifiers}}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `i {\emph{insensible à la case}}` & `g {\emph{match global}}` \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`m {\emph{multiligne matching}}`} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Brackets}}`} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} `{[}abc{]} ou {[}a-c{]}` & `{\emph{Correspond à n'importe quels caractères entre les crochets}}` \tn % Row Count 8 (+ 3) % Row 5 \SetRowColor{white} `{[}\textasciicircum{}abc{]} ou {[}\textasciicircum{}a-c{]}` & `{\emph{Correspond à tout ce qui n'est pas indiqué entre les crochets.}}` \tn % Row Count 12 (+ 4) % Row 6 \SetRowColor{LightBackground} `{[}a-ZA-Z-0-9\_{]}` & `{\emph{Tout caractères qui n'est pas une lettre ou un chiffre}}` \tn % Row Count 15 (+ 3) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{[}0-9{]}`} \tn % Row Count 16 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{[}A-z{]}`} \tn % Row Count 17 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`(a|b|c)`} \tn % Row Count 18 (+ 1) % Row 10 \SetRowColor{LightBackground} `x|y` & `{\emph{Correspond à 'x' ou 'y'}}` \tn % Row Count 20 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Character classes}}`} \tn % Row Count 21 (+ 1) % Row 12 \SetRowColor{LightBackground} `\textbackslash{}w {\emph{word}}` & `\textbackslash{}W {\emph{NOT word}}` \tn % Row Count 22 (+ 1) % Row 13 \SetRowColor{white} `\textbackslash{}d {\emph{digit}}` & `\textbackslash{}D {\emph{NOT digit}}` \tn % Row Count 23 (+ 1) % Row 14 \SetRowColor{LightBackground} `\textbackslash{}s {\emph{whitespace}}` & `\textbackslash{}S {\emph{NOT whitespace}}` \tn % Row Count 24 (+ 1) % Row 15 \SetRowColor{white} `\textbackslash{}t {\emph{tabs}}` & `\textbackslash{}n {\emph{line breaks}}` \tn % Row Count 25 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Quantifiers}}`} \tn % Row Count 26 (+ 1) % Row 17 \SetRowColor{white} `z? {\emph{0 ou 1 occurrence}}` & `z{\emph{ }}0 ou multiple occurrences*` \tn % Row Count 28 (+ 2) % Row 18 \SetRowColor{LightBackground} `z+ {\emph{1 ou multiple occurrences}}` & `z\{n\} {\emph{n occurrences}}` \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{7.5988 cm} x{9.6712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Regexp (cont)}} \tn % Row 19 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`z\{min,max\} min/max occurrences`} \tn % Row Count 1 (+ 1) % Row 20 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{\bf{Anchors}}`} \tn % Row Count 2 (+ 1) % Row 21 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`\textasciicircum{}hello {\emph{start of the strings}}`} \tn % Row Count 3 (+ 1) % Row 22 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`hello\$ {\emph{end of the string}}`} \tn % Row Count 4 (+ 1) % Row 23 \SetRowColor{LightBackground} `\textbackslash{}b {\emph{limite de mot}}` & `\textbackslash{}B {\emph{pas limite de mot}}` \tn % Row Count 6 (+ 2) % Row 24 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`x(?=y) ~ ` `{\emph{ 'x' s'il est suivi de 'y'}}`} \tn % Row Count 7 (+ 1) % Row 25 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`x(?|y|) ~ ` ` {\emph{'x' s'il n'est pas suivi de 'y'}}`} \tn % Row Count 9 (+ 2) % Row 26 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`(?\textless{}=y)x ~ ` `{\emph{'x' s'il est précédé par 'y'}}`} \tn % Row Count 11 (+ 2) % Row 27 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`(?\textless{}!y)x ~ ` `{\emph{x' s'il n'est pas précédé par 'y'}}`} \tn % Row Count 13 (+ 2) % Row 28 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{\emph{String regexp function}}`} \tn % Row Count 14 (+ 1) % Row 29 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`match() search() replace() split()`} \tn % Row Count 15 (+ 1) % Row 30 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{`{\emph{regexp methods}}`} \tn % Row Count 16 (+ 1) % Row 31 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{`test() exec()`} \tn % Row Count 17 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Statement}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{if ... else}}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`if (condition) \{ \{\{nl\}\} ~ statement\_1; \{\{nl\}\} \} else \{ \{\{nl\}\} ~ statement\_2; \{\{nl\}\} \}`} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{switch}}`} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`switch (expression) \{ \{\{nl\}\} ~ case label\_1: \{\{nl\}\} ~ ~ statement\_1 \{\{nl\}\} ~ ~ {[}break;{]} case label\_2: \{\{nl\}\} ~ ~ statement\_2 \{\{nl\}\} ~ ~ {[}break;{]} \{\{nl\}\} ~ ... \{\{nl\}\} ~ ~ default: \{\{nl\}\} ~ ~ default\_statement \{\{nl\}\} ~ ~ {[}break;{]} \{\{nl\}\} \}`} \tn % Row Count 11 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Loops}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{while }}`} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`while (condition)\{ \{\{nl\}\} ~ //code to run \{\{nl\}\} ~ final-expression \{\{nl\}\} \}; `} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{do ... while}}`} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`do \{ \{\{nl\}\} ~ //code to run \{\{nl\}\} ~final-expression \{\{nl\}\} \} while (exit-condition);`} \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{for }}`} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`for ({[}Initiale{]}; {[}condition{]}; {[}Incrémt{]}) \{ \{\{nl\}\} ~ //code to run \{\{nl\}\} \};`} \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{label}}`} \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`label : \{\{nl\}\} ~ instruction`} \tn % Row Count 11 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{break {[}label{]}}}`} \tn % Row Count 12 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`for (i = 0; i \textless{} a.length; i++) \{ \{\{nl\}\} ~ if (a{[}i{]} === valeurTest) \{ \{\{nl\}\} ~ ~ break; \{\{nl\}\} ~ \} \{\{nl\}\}\}`} \tn % Row Count 15 (+ 3) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{continue {[} label {]};}}`} \tn % Row Count 16 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`while (i \textless{} 5) \{ \{\{nl\}\} ~ i++; \{\{nl\}\} ~ if (i === 3) \{ \{\{nl\}\} ~ ~ continue; \{\{nl\}\} ~ \} n += i; \{\{nl\}\} \}`} \tn % Row Count 19 (+ 3) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{for ... in}}`} \tn % Row Count 20 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`for (variable in objet) \{ \{\{nl\}\} ~ //code to run\{\{nl\}\} \};`} \tn % Row Count 22 (+ 2) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{`{\bf{for ... of}}`} \tn % Row Count 23 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{`for (variable of objet) \{ \{\{nl\}\} ~ //code to run \{\{nl\}\} \};`} \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \end{document}