投稿時間:2023-07-31 14:24:28 RSSフィード2023-07-31 14:00 分まとめ(26件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia News] 勉強になる「本格リズムゲーム」、セガとベネッセが共同開発 英検1級レベルまで対応 https://www.itmedia.co.jp/news/articles/2307/31/news121.html 提供開始 2023-07-31 13:40:00
IT ITmedia 総合記事一覧 [ITmedia エンタープライズ] AIによる「意思決定の自動化」は“正しいこと”なのか? IBMの最新調査から考察 https://www.itmedia.co.jp/enterprise/articles/2307/31/news077.html itmedia 2023-07-31 13:35:00
IT ITmedia 総合記事一覧 [ITmedia PC USER] ベンキュー、ハードウェアキャリブレーションに対応したプロ向けのWQHD/4K対応27型液晶ディスプレイ2製品 https://www.itmedia.co.jp/pcuser/articles/2307/31/news117.html itmediapcuser 2023-07-31 13:21:00
IT ITmedia 総合記事一覧 [ITmedia エンタープライズ] ChatGPTが”ばか”になっている? 研究で明らかになった「噂の真相」 https://www.itmedia.co.jp/enterprise/articles/2307/31/news064.html chatgpt 2023-07-31 13:15:00
IT ITmedia 総合記事一覧 [ITmedia News] JAL、業務効率化に量子コンピュータ活用へ 整備計画の最適化に https://www.itmedia.co.jp/news/articles/2307/31/news115.html itmedianewsjal 2023-07-31 13:10:00
IT ITmedia 総合記事一覧 [ITmedia News] カラー、短編アニメ「カセットガール」をYouTubeで1週間だけ公開 「若きクリエイターたちが作り出した新境地」 https://www.itmedia.co.jp/news/articles/2307/31/news116.html 期間限定 2023-07-31 13:06:00
IT ITmedia 総合記事一覧 [ITmedia Mobile] 機内エンタメを無線イヤフォンで聴けるBluetoothオーディオトランスミッター/レシーバー エレコムから https://www.itmedia.co.jp/mobile/articles/2307/31/news114.html bluetooth 2023-07-31 13:02:00
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders 日本航空、量子アニーリングで運航整備計画を作成するシステムの開発に着手 | IT Leaders https://it.impress.co.jp/articles/-/25167 日本航空、量子アニーリングで運航整備計画を作成するシステムの開発に着手ITLeaders日本航空本社東京都品川区、JALは年月日、運航整備計画を量子コンピューティング量子アニーリングを活用して最適化・立案するアプリケーションを開発すると発表した。 2023-07-31 13:47:00
AWS AWS Japan Blog 週刊AWS – 2023/7/24週 https://aws.amazon.com/jp/blogs/news/aws-weekly-20230724/ amazon 2023-07-31 04:21:09
python Pythonタグが付けられた新着投稿 - Qiita djangoで、一意制約を持ったカラムの値を入れ替える https://qiita.com/76r6qo698/items/88b58349d02a55b6a512 django 2023-07-31 13:44:45
js JavaScriptタグが付けられた新着投稿 - Qiita jQuery HTML系メソッド https://qiita.com/thirai67/items/4d7f32cb90f877f22f15 constcontentselectorhtml 2023-07-31 13:59:50
海外TECH DEV Community Front end practice: Top 25+ Javascript code best practices for development https://dev.to/lakshmananarumugam/front-end-practice-top-25-javascript-code-best-practices-for-development-4c1d Front end practice Top Javascript code best practices for developmentIn a previous article I covered front end best practices in CSS SCSS This article will share the basic javascript best practices for developmentFrontend development in JavaScript involves creating user interfaces and handling the presentation layer of web applications Here are some best practices to follow along with examples to ensure a clean and maintainable codebase Modularization Break down your code into smaller reusable modules This enhances code readability and makes it easier to manage dependencies Example users js module export function getUsers Fetch users from the API or data source main js entry point import getUsers from users js getUsers Use const and let Prefer const for variables that won t be reassigned and let for variables that will change Example const PI let count count ValidPI Error Avoid global variables Minimize the use of global variables to prevent polluting the global scope and potential conflicts Example Avoid thislet globalVar I am global function someFunction Use this instead function let localVar I am local function someFunction Use arrow functions Arrow functions provide concise syntax and maintain the lexical this value reducing the need for bind Example Regular functionfunction add a b return a b Arrow functionconst add a b gt a b Avoid polluting the global namespace Encapsulate your code within a module or an IIFE Immediately Invoked Function Expression to avoid global namespace pollution Example Instead offunction myFunction Use this function function myFunction Call the function or attach it to the desired scope myFunction Use modern ES features Embrace ES features like destructuring spread syntax and template literals to write more concise and expressive code Example Destructuringconst firstName lastName user Spread syntaxconst arr const arr const combinedArray arr arr Template literalsconst name My name is firstName lastName Avoid inline styles and use CSS classes Keep your HTML and JavaScript code separated Use CSS classes for styling and manipulate classes with JavaScript instead of inline styles Example lt Bad Inline style gt lt button style background color bff color fff gt Click Me lt button gt lt Good CSS class gt lt button class primary btn gt Click Me lt button gt Optimize DOM manipulation Minimize direct DOM manipulation and use efficient approaches like template literals or libraries frameworks that efficiently update the DOM Example using template literals const data Item Item Item function renderList data const list document getElementById list list innerHTML data forEach item gt const listItem document createElement li listItem textContent item list appendChild listItem renderList data Use event delegation Attach event listeners to parent elements and utilize event delegation for handling events on dynamically added elements Example lt ul id list gt lt List items will be added dynamically gt lt ul gt document getElementById list addEventListener click event gt if event target nodeName LI Handle click on list item console log event target textContent Optimize asset loading Minimize the number of HTTP requests and use techniques like bundling and minification to optimize asset loading Error Handling Always handle errors gracefully to avoid unexpected application crashes and improve user experience Example function divide a b if b throw new Error Division by zero is not allowed return a b try const result divide console log result catch error console error An error occurred error message Use Promises or Async Await for Asynchronous Operations Avoid using nested callbacks for asynchronous operations and use Promises or Async Await to improve code readability and maintainability Example using Promises function fetchData return fetch then response gt response json fetchData then data gt console log data catch error gt console error Error fetching data error Example using Async Await async function fetchData try const response await fetch const data await response json return data catch error throw new Error Error fetching data error async gt try const data await fetchData console log data catch error console error error message Avoid Manipulating the DOM Directly in Loops When performing DOM manipulation inside loops batch the changes or use DocumentFragment to minimize layout thrashing and improve performance Example Bad Directly manipulating DOM in a loopconst list document getElementById list for let i i lt i const listItem document createElement li listItem textContent Item i list appendChild listItem Good Batch changes using DocumentFragmentconst list document getElementById list const fragment document createDocumentFragment for let i i lt i const listItem document createElement li listItem textContent Item i fragment appendChild listItem list appendChild fragment Use Debouncing or Throttling for Event Handlers When handling events that could trigger frequently e g resize or scroll use debouncing or throttling techniques to reduce the number of function calls and improve performance Example using Lodash s debounce function import debounce from lodash function handleResize Code to handle window resize window addEventListener resize debounce handleResize Use Semantic HTML Write meaningful and semantic HTML to improve accessibility SEO and maintainability Example lt Bad Using generic divs gt lt div class header gt lt div class title gt My Website lt div gt lt div gt lt Good Using semantic HTML gt lt header gt lt h gt My Website lt h gt lt header gt Use ES Modules instead of Global Scripts Organize your JavaScript code into separate modules and use ES import and export statements instead of loading multiple scripts in the global scope Example Module module jsexport function foo Example Module module jsexport function bar Example Main Script main jsimport foo from module js import bar from module js foo bar Avoid Nested Ternary Operators While ternary operators can be useful for concise expressions nesting them can lead to code that is hard to read and understand Instead use regular if else statements for complex conditions Example Bad Nested ternaryconst result condition value condition value condition value defaultValue Good Using if elselet result if condition result value else if condition result value else if condition result value else result defaultValue Avoid Excessive Comments Comments are essential for code documentation but avoid over commenting self explanatory code Let the code speak for itself whenever possible Example Bad Excessive commentsfunction add a b This function adds two numbers and returns the result return a b Return the sum Good Minimal self explanatory commentsfunction add a b return a b Use Object Shorthand When creating object literals with properties that have the same name as the variables use object shorthand for cleaner code Example Bad Repetitive codeconst firstName John const lastName Doe const user firstName firstName lastName lastName Good Object shorthandconst firstName John const lastName Doe const user firstName lastName Avoid Using eval The eval function can execute arbitrary code and is generally considered unsafe and bad practice Find alternative solutions to achieve your goals without using eval Example Bad Avoid eval const expression const result eval expression console log result Output Use textContent Instead of innerHTML When working with plain text content prefer textContent over innerHTML to prevent potential security vulnerabilities e g cross site scripting XSS Example Bad Using innerHTML for plain textconst text lt script gt alert Hello XSS lt script gt const element document getElementById myElement element innerHTML text This will execute the script Good Using textContentconst text lt script gt alert Hello XSS lt script gt const element document getElementById myElement element textContent text Treats it as plain text no script execution Use addEventListener Instead of Inline Event Handlers Instead of using inline event handlers in HTML e g onclick myFunction use addEventListener in JavaScript for better separation of concerns Example Bad Inline Event Handler lt button onclick handleClick gt Click Me lt button gt function handleClick Event handling logic Example Good addEventListener lt button id myButton gt Click Me lt button gt document getElementById myButton addEventListener click handleClick function handleClick Event handling logic Use const and let instead of var Prefer const and let over var for variable declarations to avoid hoisting and block scoping issues Example Bad Using varvar x Good Using const or letconst x let y Use map filter and reduce for Array Operations Utilize higher order array methods like map filter and reduce to perform operations on arrays in a functional and declarative manner Example using map const numbers const doubledNumbers numbers map num gt num console log doubledNumbers Output Example using filter const numbers const evenNumbers numbers filter num gt num console log evenNumbers Output Example using reduce const numbers const sum numbers reduce acc num gt acc num console log sum Output Avoid document write The use of document write can cause unexpected behavior and overwrite the entire document if used after the page has finished loading Use DOM manipulation methods instead Example Bad Avoid document write document write lt h gt Hello World lt h gt Use classList for Managing CSS Classes Instead of directly manipulating the className use classList methods like add remove toggle and contains to manage CSS classes Example lt div id myDiv class container gt Content lt div gt const element document getElementById myDiv Adding a classelement classList add highlight Removing a classelement classList remove container Checking if a class existsif element classList contains highlight Do something Toggling a classelement classList toggle active Use requestAnimationFrame for Smooth Animations When creating animations use requestAnimationFrame to ensure smooth and efficient animations that run at the optimal frame rate Example function animate Code to update the animation requestAnimationFrame animate Start the animationanimate Avoid Synchronous AJAX Requests Avoid using synchronous XMLHttpRequest XHR as it can block the main thread causing a poor user experience Instead use asynchronous requests with Promises async await or callbacks Example using Promises function fetchData return fetch then response gt response json fetchData then data gt console log data catch error gt console error Error fetching data error Example using async await async function fetchData try const response await fetch const data await response json return data catch error throw new Error Error fetching data error async gt try const data await fetchData console log data catch error console error error message Thanks for reading Popular articles Advanced TypeScript Tips for DevelopmentEnum in javascript 2023-07-31 04:30:00
金融 日本銀行:RSS 経済・物価情勢の展望(7月、全文) http://www.boj.or.jp/mopo/outlook/gor2307b.pdf 物価情勢の展望 2023-07-31 14:00:00
ニュース BBC News - Home Ukraine war: 'People call us the Ghosts of Bakhmut' https://www.bbc.co.uk/news/world-europe-66354363?at_medium=RSS&at_campaign=KARANGA bakhmut 2023-07-31 04:44:28
ニュース BBC News - Home No hope of survivors from MRH-90 helicopter crash in Australia https://www.bbc.co.uk/news/world-australia-66357395?at_medium=RSS&at_campaign=KARANGA catastrophic 2023-07-31 04:28:45
ニュース BBC News - Home Qatar: Man walks slackline 185m above ground https://www.bbc.co.uk/news/world-middle-east-66356638?at_medium=RSS&at_campaign=KARANGA lusail 2023-07-31 04:37:13
ニュース BBC News - Home Newspaper headlines: Putin 'peace bombshell' and North Sea licences https://www.bbc.co.uk/news/blogs-the-papers-66356698?at_medium=RSS&at_campaign=KARANGA moscow 2023-07-31 04:26:59
ビジネス ダイヤモンド・オンライン - 新着記事 欧州が避ける中国「一帯一路」イベント - WSJ発 https://diamond.jp/articles/-/326990 一帯一路 2023-07-31 13:02:00
ビジネス 東洋経済オンライン 三菱自の中国合弁が「操業停止」人員整理に着手 負債1100億円超え、「EVシフト」で再建を図る | 「財新」中国Biz&Tech | 東洋経済オンライン https://toyokeizai.net/articles/-/689444?utm_source=rss&utm_medium=http&utm_campaign=link_back biztech 2023-07-31 13:30:00
マーケティング MarkeZine 【参加無料・特典あり】ChatGPTを活用した「BtoBメルマガコンテンツ企画術」を解説 http://markezine.jp/article/detail/42953 chatgpt 2023-07-31 13:30:00
マーケティング MarkeZine マーケティング予算を無駄にしない!激変するデジタル環境に振り回されない戦略の構築法とは【参加無料】 http://markezine.jp/article/detail/42950 参加無料 2023-07-31 13:15:00
IT 週刊アスキー 横浜スタジアム外周で観戦とグルメを堪能! 入場無料の「ハマスタBAYビアガーデン」8月4日から https://weekly.ascii.jp/elem/000/004/147/4147510/ 入場無料 2023-07-31 13:30:00
IT 週刊アスキー 中区役所などもユニフォームを着用して応援 「YOKOHAMA STAR☆NIGHT 2023 Supported by 横浜銀行」開催間近 https://weekly.ascii.jp/elem/000/004/147/4147507/ hamastarnightsupportedby 2023-07-31 13:15:00
マーケティング AdverTimes 立命館大学、新生「大阪いばらきキャンパス」のコンセプトムービー公開 https://www.advertimes.com/20230731/article429021/ abema 2023-07-31 04:46:09
マーケティング AdverTimes 生成AIの活用が進んでも、変わらず必要な広報スキルは? https://www.advertimes.com/20230731/article428798/ 上場企業 2023-07-31 04:45:50
マーケティング AdverTimes ぺんてるが新タグライン公開 「自らの世界を描く」ことを支える企業として https://www.advertimes.com/20230731/article428906/ reimagineyourworld 2023-07-31 04:09:26

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)