こんにちは、コンテンツ事業部の井田です。 さて、今回はjavascriptに関連する投稿です。 弊社でもここ1年ほどでjavascriptの最新技術の取り入れが盛んになってきました。 しかし、数年間続くシステムだと最新どころかスパゲッティ化してしまって動いているけど手を入れづらいことがあるかと思います。 往々にして数年前の自分がやらかしてたりするんですが… 数カ月前にこういった状況に実際に直面し、思い切ってES6の構文を取り入れつつリファクタを実施してみました。 今回はその実施内容のご紹介です。 ※リファクタに際しbabel,gulpなどのツールを用いましたが今回はその導入手順は省略させていただきます。 Beforeまずは実施前のコードの構造がどうだったかを簡単に。 <div>......</div> <script> $(function() { $.ajax({//機能Aに関するデータ