更新情報
・constをletに修正、問題を追加(2024/9/27)
・問題を追加(2024/7/20)
・問題を追加(2024/4/12)| //ex1 //値返す書き方 | |
| var myApp = angular.module('MyApp',[]); | |
| myApp.factory('myUrlFactory',function myUrlFunc(){ | |
| return 'https://github.com/kenjimorita/'; | |
| }) | |
| //ex2 //関数を返す書き方 | |
| var myApp = angular.module('MyApp',[]); | |
| myApp.factory('myFunc',function($window){ | |
| return{ |
| module moritaA{ | |
| export interface Imorita {//(1) | |
| get: Function; | |
| num1: number; | |
| num2: number; | |
| } | |
| export class Aclass implements Imorita{ | |
| public num1:number = 1 | |
| public num2:number = 4 | |
| constructor(){ |
| module A{ | |
| interface ImoritaA{ | |
| name:string; | |
| } | |
| class Aclass implements ImoritaA{ | |
| constructor(public name){ | |
| this.name = "fafa" | |
| } | |
| public func1= ()=>{//constructor外、無名関数を代入 | |
| } |
| var __extends = (this && this.__extends) || function (d, b) { | |
| for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
| function __() { this.constructor = d; } | |
| __.prototype = b.prototype; | |
| d.prototype = new __(); | |
| }; | |
| var Person = (function () { | |
| function Person(name) { | |
| this.name = name; | |
| } |
| //ex1 babel | |
| function today() { return { d: 6, m: 2, y: 2013 }; } | |
| var { m: month, y: year } = today(); // month = 2, year = 2013 | |
| //ex1 after | |
| "use strict"; | |
| function today() { | |
| return { d: 6, m: 2, y: 2013 }; | |
| } | |
| var _today = today();//関数名が「_変数」になっている |
| // Bad | |
| var o = { | |
| set a(value) { | |
| this.val = value; | |
| } | |
| }; | |
| // Good | |
| var o = { | |
| set a(value) { |
| /*eslint array-bracket-spacing: [2, "never"]*/ | |
| var arr = [ 'foo', 'bar' ]; /*error There should be no space after '['*/ /*error There should be no space before ']'*/ | |
| var arr = ['foo', 'bar' ]; /*error There should be no space before ']'*/ | |
| var arr = [ ['foo'], 'bar']; /*error There should be no space after '['*/ | |
| var arr = [[ 'foo' ], 'bar']; /*error There should be no space after '['*/ /*error There should be no space before ']'*/ | |
| var arr = ['foo', | |
| 'bar' | |
| ]; | |
| var [ x, y ] = z; /*error There should be no space after '['*/ /*error There should be no space before ']'*/ | |
| var [ x,y ] = z; /*error There should be no space after '['*/ /*error There should be no space before ']'*/ |
問1
const a = {a: 'a'}とconst b = {b: 'b'}
をマージしたc
を出力してください
e.g{a:'a',b:'b'}
const a = {a: 'a'};| //mapを作成 | |
| var map1 = Immutable.Map({ | |
| a: 1, | |
| b:2, | |
| c: 3 | |
| });] | |
| //新しい配列やMapを返すところ。不変なオブジェクトを返す |