| | |
| | | const list = [ |
| | | [310104501, '漕河泾新兴技术开发区'], |
| | | [310104004, '湖南路街道'], |
| | | [310104003, '天平路街道'], |
| | | [310104012, '虹梅路街道'], |
| | | [310104008, '枫林路街道'], |
| | | [310104007, '斜土路街道'], |
| | | [310104010, '长桥街道'], |
| | | [310104011, '田林街道'], |
| | | [310104013, '康健新村街道'], |
| | | [310104014, '徐家汇街道'], |
| | | [310104015, '凌云路街道'], |
| | | [310104016, '龙华街道'], |
| | | [310104017, '漕河泾街道'], |
| | | [310104103, '华泾镇'], |
| | | ]; |
| | | const shape = { |
| | | radius: 9, |
| | | d() { |
| | | return this.radius * 2; |
| | | }, |
| | | p: () => 2 * Math.PI * this.radius, |
| | | }; |
| | | |
| | | const result = []; |
| | | list.forEach((l) => { |
| | | result.push({ |
| | | label: l[1], |
| | | value: l[0] + '', |
| | | }); |
| | | }); |
| | | console.log(shape.d()); |
| | | console.log(shape.p()); |
| | | |
| | | console.log(result); |
| | | const str = 'abc'; |
| | | if (str[0] >= 'a' && str[0] <= 'z') { |
| | | let a = parseInt(str[0]); |
| | | a -= 32; |
| | | console.log(a); |
| | | } |