[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571523-105":53,"doc-detail-571523-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","javascript-devsheets-syntax-collections-quick-reference","JAVASCRIPT - DevSheets - Syntax & Collections - Quick Reference","","Quick reference cheat sheet for JavaScript, organized by topic and numbered sections. Covers core syntax and data types, operators and truthiness, string and array operations, transformations and searching, objects with safe access, destructuring and spread, plus Map and Set. Includes control flow, functions, browser DOM and events, modules, JSON and local storage, Promises and async/await, fetch with error handling, and common pitfalls such as strict vs loose equality and mutating operations.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/javascript-devsheets-syntax-collections-quick-reference/571523/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/javascript-devsheets-syntax-collections-quick-reference/571523.png","ImageObject",442,249,{"name":88,"@type":89},"miaandmiso","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-21","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",6,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do you run JavaScript and print output in this guide?","Question",{"text":109,"@type":110},"Use the DevTools console in your browser for quick testing. To run files with Node.js, execute node --version and run node app.js. Output is shown using console.log(value).","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What are the key differences between == and === in JavaScript?",{"text":114,"@type":110},"The guide recommends using === to avoid type coercion. It contrasts === / !== strict equality and inequality with the loose == behavior that can coerce types.",{"name":116,"@type":107,"acceptedAnswer":117},"How does the cheat sheet show asynchronous programming with Promises and async/await?",{"text":118,"@type":110},"It defines async functions returning Promises and uses await inside async contexts. It also demonstrates Promise.all for running multiple async operations together and shows fetch error handling using res.ok and .catch(console.error).","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},571523,1792271776,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":9},7971478544854,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","QUICK REFERENCE / JAVASCRIPT  \nJavaScript The essentials, at a glance.  \n  DevSheets  \n01 / SYNTAX & COLLECTIONS  \n 01  Start here  \nTry expressions in your browser DevTools console. To run a file, install Node.js: [nodejs.org](nodejs.org)  \nnode --version  \nnode app.js  \nSave JavaScript in app.js. Use console. log(value) for output. // starts a line comment.  \n 02  Variables & types  \nconst name = \"Maya\" ; // string  \nlet score = 82 ; // number  \nscore += 1 ;  \nconst active = true; // boolean  \nconst nothing = null; // intentional absence let pending; // undefined  \ntypeof score; // \"number\"  \nDefault to const; use let for reassignment. Both are block-scoped. const does not freeze objects.  \n 03  Operators & truthiness  \n+ - * / % ** Arithmetic, remainder, power  \n=== / !== Strict equality / inequality  \n\u003C > \u003C= >= Compare values  \n&& || ! Logical AND, OR, NOT  \nNumber(\"42\"); // 42 String(42); // \"42\"  \n5 === \"5\" ; // false  \nFalsy: false, 0, -0, 0n, \"\", null, undefined, NaN. Empty arraysand objects are truthy.  \n 04  Strings  \nconst name = \"Maya\" ;  \n`Hi, ${name}!` ; // \"Hi, Maya!\"  \n\" hi \" .trim(); // \"hi\"  \n\"Hello\" .toLowerCase(); // \"hello\"\"hello\" .includes(\"ell\"); // true\"a,b\" .split(\",\"); // [\"a\", \"b\"]  \n[ \"a\" , \"b\"] .join( \" - \" ); // \"a-b\"  \nStrings are immutable. Backticks allow ${expression} to insert a value.  \n 05  Arrays  \nconst nums = [10 , 20 , 30];  \nnums.push(40); // append  \nnums .pop(); // remove and return 40  \nnums.length; // 3  \nnums[0]; // 10  \n[nums.at](nums.at) (-1); // 30  \nnums.slice(1 , 3); // [20, 30]  \nIndexes start at 0. slice(start, end) excludes end and returns anew array. push/pop change nums.  \n 06  Transform & search  \nconst nums = [1 , 2 , 3 , 4];  \n[nums.map](nums.map) (n => n * 2); // [2, 4, 6, 8] nums .filter(n => n > 2); // [3, 4] nums .find(n => n > 2); // 3  \nnums .some(n => n > 3); // true nums .every(n => n > 0); // true  \nnums . reduce((sum, n) => sum + n, 0); // 10  \nmap transforms; filter selects; reduce combines. find returns undefined if nothing matches.  \n 07  Objects & safe access  \nconst user = { name: \"Maya\" , age: 28 };  \n[user.name](user.name) ; // \"Maya\"  \nuser[\"age\"] = 29 ;  \nObject.keys(user); // [\"name\", \"age\"] [user.address?.city](user.address?.city) ; // undefined user . role ?? \"guest\" ; // \"guest\"  \n?. stops on null or undefined. ?? supplies a fallback only for null or undefined, keeping 0 and false.  \n 08  Destructuring & spread  \nconst user = { name: \"Maya\" , age: 28 }; const { name, role = \"guest\" } = user; const [first, . . . rest] = [10 , 20 , 30];// first: 10; rest: [20, 30]  \nconst copy = { . . .user, age: 29 };  \nconst all = [first, . . . rest, 40];  \nDestructuring pulls values out   spreads values or collects the rest. These copies are shallow: nested objects are still shared.  \n 09  Map & Set  \nconst scores = new Map();  \nscores.set( \"Maya\" , 82); scores.get(\"Maya\"); // 82  \nscores.has(\"Leo\"); // false  \nconst tags = new Set([ \"web\" , \"web\"]); tags.add(\"api\");  \ntags.has(\"web\"); // true  \n[ . . .tags]; // [\"web\", \"api\"]  \nMap stores key-value pairs with keys of any type. Set holds unique values. Both expose .size.  \nQUICK REFERENCE / JAVASCRIPT  \nJavaScript Everyday patterns, ready to use.  \n  DevSheets  \n02 / CONTROL FLOW & WEB APIS  \n 10  Conditionals  \nconst score = 82 ;  \nif (score >= 90) { console.log(\"A\");  \n} else if (score >= 80) { console.log(\"B\");  \n} else {  \nconsole.log(\"C\");}  \nFor an expression: condition ? valueIfTrue : valueIfFalse.  \n 11  Loops  \nconst names = [ \"Maya\" , \"Leo\"];  \nfor (const name of names) { console.log(name);  \n}  \nfor (let i = 0 ; i \u003C 3 ; i++) {  \nconsole.log(i); // 0, then 1, then 2}  \nfor...of reads iterable values; [for...in](for...in) reads enumerable property names. break exits; continue skips to the next iteration.  \n 12  Functions  \nfunction greet(name = \"friend\") { return `Hello, ${name}!` ;  \n}  \ngreet(\"Maya\"); // \"Hello, Maya!\"const add = (a, b) => a + b; add(2 , 3); // 5  \nArrows inherit this; use return ins","cbCaii2wt95oVQWY","https://ap.wps.com/l/cbCaii2wt95oVQWY","pdf",80347,"English","# 01 - SYNTAX & COLLECTIONS\n## 01 Start here\n## 02 Variables & types\n## 03 Operators & truthiness\n## 04 Strings\n## 05 Arrays\n## 06 Transform & search\n## 07 Objects & safe access\n## 08 Destructuring & spread\n## 09 Map & Set\n# 02 - CONTROL FLOW & WEB APIS\n## 10 Conditionals\n## 11 Loops\n## 12 Functions\n## 13 DOM & events\n## 14 Modules\n## 15 JSON & browser storage\n## 16 Promises & async\n## 17 Fetch & errors\n## 18 Common pitfalls","[{\"question\":\"How do you run JavaScript and print output in this guide?\",\"answer\":\"Use the DevTools console in your browser for quick testing. To run files with Node.js, execute node --version and run node app.js. Output is shown using console.log(value).\"},{\"question\":\"What are the key differences between == and === in JavaScript?\",\"answer\":\"The guide recommends using === to avoid type coercion. It contrasts === / !== strict equality and inequality with the loose == behavior that can coerce types.\"},{\"question\":\"How does the cheat sheet show asynchronous programming with Promises and async/await?\",\"answer\":\"It defines async functions returning Promises and uses await inside async contexts. It also demonstrates Promise.all for running multiple async operations together and shows fetch error handling using res.ok and .catch(console.error).\"}]","JAVASCRIPT - DevSheets - Syntax & Collections - Quick Reference | PDF",1791921874]