Fighting is strong against Normal because:
- A trained fighter will beat a normal person in combat
Fighting is strong against Rock because:
- Fighting hits so hard it shatters rock
Fighting is strong against Steel because:
const createElement = ( type, props = {}, ...children ) => ({ type, props, children }) |
Result: 1 | |
Items { | |
TemplateId: "BADGE_BATTLE_ATTACK_WON" | |
Badge { | |
BadgeType: BADGE_BATTLE_ATTACK_WON | |
BadgeRanks: 4 | |
Targets: "\nd\350\007" | |
} | |
} | |
Items { |
Fighting is strong against Normal because:
Fighting is strong against Rock because:
Fighting is strong against Steel because:
<div><canvas width="640" height="480" /></div> | |
<!-- | |
WebGL CRT monitor effect demo with a tiny surprise. Uses offscreen 2D canvas as buffer source. | |
Libraries and sources: | |
- ReGL (WebGL helper): http://regl.party/ | |
- glMatrix (math): http://glmatrix.net/ |
export const Hedgehog = () => { | |
const speed = 10000 | |
const name = 'Sonic' | |
const hedgehog = { | |
name, | |
zoom: () => zoom( hedgehog.name, speed ) | |
} | |
return hedgehog |
export const createPoint = ( x, y ) => ({ x, y }) | |
export const isPoint = value => | |
value && typeof value.x === 'number' && typeof value.y === 'number' | |
export const translatePoint = ( { x: x0, y: y0 }, { x: x1, y: y1 } ) => | |
createPoint( x0 + x1, y0 + y1 ) |
export const createRobot = ( name, job ) => ({ name, job }) | |
export const isRobot = value => | |
value && typeof value.name === 'string' && typeof value.job === 'string' | |
export const introduceRobot = ({ name, job }) => | |
console.log( `Hi, I'm ${ name }. My job is ${ job }.` ) |
// it's array-like, but it's not an array | |
const notAnArray = { | |
length: 3, | |
0: 'a', | |
1: 'b', | |
2: 'c' | |
} | |
console.log( Array.isArray( notAnArray ) ) // false |
import { Shape } from './shapes.types' | |
import { area, perimeter } from './shapes.lib' | |
const shapes: Shape[] = [ | |
{ radius: 4 }, { side: 5 }, { width: 6, height: 7 } | |
] | |
const totalArea = shapes.reduce( | |
( sum, shape ) => sum + area( shape ), | |
0 |
export const objectFilter = ( obj, predicate ) => { | |
if ( obj === null || obj === undefined ) | |
throw Error( 'Cannot convert null or undefined to an object' ) | |
if ( typeof predicate !== 'function' ) | |
throw Error( 'Expected predicate to be a function' ) | |
obj = Object( obj ) | |
return Object.keys( obj ).reduce( |