本文实例讲述了包含中国城市的javascript对象。分享给大家供大家参考。具体如下:
各种苦逼无聊的需求:
City2Num['北京']=010
Num2City['010']=北京
var City2Num = { "北京": "010", "上海": "021", "天津": "022", "重庆": "023", "香港": "852", "邯郸": "0310", "石家庄": "0311", "保定": "0312", "张家口": "0313", "承德": "0314", "唐山": "0315", "廊坊": "0316", "沧州": "0317", "衡水": "0318", "邢台": "0319", "秦皇岛": "0335", "衢州": "0570", "杭州": "0571", "湖州": "0572", "嘉兴": "0573", "宁波": "0574", "绍兴": "0575", "台州": "0576", "温州": "0577", "丽水": "0578", "金华": "0579", "舟山": "0580", "沈阳": "024", "铁岭": "0410", "大连": "0411", "鞍山": "0412", "抚顺": "0413", "本溪": "0414", "丹东": "0415", "锦州": "0416", "营口": "0417", "阜新": "0418", "辽阳": "0419", "朝阳": "0421", "盘锦": "0427", "葫芦岛": "0429", "武汉": "027", "襄城": "0710", "鄂州": "0711", "孝感": "0712", "黄州": "0713", "黄石": "0714", "咸宁": "0715", "荆沙": "0716", "宜昌": "0717", "恩施": "0718", "十堰": "0719", "随枣": "0722", "荆门": "0724", "江汉": "0728", "南京": "025", "无锡": "0510", "镇江": "0511", "苏州": "0512", "南通": "0513", "扬州": "0514", "盐城": "0515", "徐州": "0516", "淮阴": "0517", "淮安": "0517", "连云港": "0518", "常州": "0519", "泰州": "0523", "新余": "0790", "南昌": "0791", "九江": "0792", "上饶": "0793", "临川": "0794", "宜春": "0795", "吉安": "0796", "赣州": "0797", "景德镇": "0798", "萍乡": "0799", "鹰潭": "0701", "忻州": "0350", "太原": "0351", "大同": "0352", "阳泉": "0353", "榆次": "0354", "长治": "0355", "晋城": "0356", "临汾": "0357", "离石": "0358", "运城": "0359", "临夏": "0930", "兰州": "0931", "定西": "0932", "平凉": "0933", "西峰": "0934", "武威": "0935", "张掖": "0936", "酒泉": "0937", "天水": "0938", "甘南州": "0941", "白银": "0943", "菏泽": "0530", "济南": "0531", "青岛": "0532", "淄博": "0533", "德州": "0534", "烟台": "0535", "淮坊": "0536", "济宁": "0537", "泰安": "0538", "临沂": "0539", "阿城": "0450", "哈尔滨": "0451", "齐齐哈尔": "0452", "牡丹江": "0453", "佳木斯": "0454", "绥化": "0455", "黑河": "0456", "加格达奇": "0457", "伊春": "0458", "大庆": "0459", "广州": "020", "韶关": "0751", "惠州": "0752", "梅州": "0753", "汕头": "0754", "深圳": "0755", "珠海": "0756", "佛山": "0757", "肇庆": "0758", "湛江": "0759", "中山": "0760", "河源": "0762", "清远": "0763", "顺德": "0765", "云浮": "0766", "潮州": "0768", "东莞": "0769", "汕尾": "0660", "潮阳": "0661", "阳江": "0662", "揭西": "0663", "成都": "028", "涪陵": "0810", "攀枝花": "0812", "自贡": "0813", "永川": "0814", "绵阳": "0816", "南充": "0817", "达县": "0818", "万县": "0819", "遂宁": "0825", "广安": "0826", "巴中": "0827", "泸州": "0830", "宜宾": "0831", "内江": "0832", "乐山": "0833", "西昌": "0834", "雅安": "0835", "康定": "0836", "马尔康": "0837", "德阳": "0838", "广元": "0839", "泸州": "0840", "岳阳": "0730", "长沙": "0731", "湘潭": "0732", "株州": "0733", "衡阳": "0734", "郴州": "0735", "常德": "0736", "益阳": "0737", "娄底": "0738", "邵阳": "0739", "吉首": "0743", "张家界": "0744", "怀化": "0745", "永州冷": "0746", "商丘": "0370", "郑州": "0371", "安阳": "0372", "新乡": "0373", "许昌": "0374", "平顶山": "0375", "信阳": "0376", "南阳": "0377", "开封": "0378", "洛阳": "0379", "焦作": "0391", "鹤壁": "0392", "濮阳": "0393", "周口": "0394", "漯河": "0395", "驻马店": "0396", "三门峡": "0398", "昭通": "0870", "昆明": "0871", "大理": "0872", "个旧": "0873", "曲靖": "0874", "保山": "0875", "文山": "0876", "玉溪": "0877", "楚雄": "0878", "思茅": "0879", "景洪": "0691", "潞西": "0692", "东川": "0881", "临沧": "0883", "六库": "0886", "中甸": "0887", "丽江": "0888", "银川": "0951", "石嘴山": "0952", "吴忠": "0953", "固原": "0954", "儋州": "0890", "海口": "0898", "三亚": "0899", "拉萨": "0891", "日喀则": "0892", "山南": "0893", "长春": "0431", "吉林": "0432", "延吉": "0433", "四平": "0434", "通化": "0435", "白城": "0436", "辽源": "0437", "松原": "0438", "浑江": "0439", "珲春": "0440", "防城港": "0770", "南宁": "0771", "柳州": "0772", "桂林": "0773", "梧州": "0774", "玉林": "0775", "百色": "0776", "钦州": "0777", "河池": "0778", "北海": "0779", "贵阳": "0851", "遵义": "0852", "安顺": "0853", "都均": "0854", "凯里": "0855", "铜仁": "0856", "毕节": "0857", "六盘水": "0858", "兴义": "0859", "西安": "029", "咸阳": "0910", "延安": "0911", "榆林": "0912", "渭南": "0913", "商洛": "0914", "安康": "0915", "汉中": "0916", "宝鸡": "0917", "铜川": "0919", "西宁": "0971", "海东": "0972", "同仁": "0973", "共和": "0974", "玛沁": "0975", "玉树": "0976", "德令哈": "0977", "澳门": "853", "海拉尔": "0470", "呼和浩特": "0471", "包头": "0472", "乌海": "0473", "集宁": "0474", "通辽": "0475", "赤峰": "0476", "东胜": "0477", "临河": "0478", "锡林浩特": "0479", "乌兰浩特": "0482", "阿拉善左旗": "0483", "福州": "0591", "厦门": "0592", "宁德": "0593", "莆田": "0594", "泉州": "0595", "晋江": "0595", "漳州": "0596", "龙岩": "0597", "三明": "0598", "南平": "0599", "滁州": "0550", "合肥": "0551", "蚌埠": "0552", "芜湖": "0553", "淮南": "0554", "马鞍山": "0555", "安庆": "0556", "宿州": "0557", "阜阳": "0558", "黄山": "0559", "淮北": "0561", "铜陵": "0562", "宣城": "0563", "六安": "0564", "巢湖": "0565", "贵池": "0566" };
var Num2City = { "010": "北京", "021": "上海", "022": "天津", "023": "重庆", "852": "香港", "0310": "邯郸", "0311": "石家庄", "0312": "保定", "0313": "张家口", "0314": "承德", "0315": "唐山", "0316": "廊坊", "0317": "沧州", "0318": "衡水", "0319": "邢台", "0335": "秦皇岛", "0570": "衢州", "0571": "杭州", "0572": "湖州", "0573": "嘉兴", "0574": "宁波", "0575": "绍兴", "0576": "台州", "0577": "温州", "0578": "丽水", "0579": "金华", "0580": "舟山", "024": "沈阳", "0410": "铁岭", "0411": "大连", "0412": "鞍山", "0413": "抚顺", "0414": "本溪", "0415": "丹东", "0416": "锦州", "0417": "营口", "0418": "阜新", "0419": "辽阳", "0421": "朝阳", "0427": "盘锦", "0429": "葫芦岛", "027": "武汉", "0710": "襄城", "0711": "鄂州", "0712": "孝感", "0713": "黄州", "0714": "黄石", "0715": "咸宁", "0716": "荆沙", "0717": "宜昌", "0718": "恩施", "0719": "十堰", "0722": "随枣", "0724": "荆门", "0728": "江汉", "025": "南京", "0510": "无锡", "0511": "镇江", "0512": "苏州", "0513": "南通", "0514": "扬州", "0515": "盐城", "0516": "徐州", "0517": "淮阴", "0517": "淮安", "0518": "连云港", "0519": "常州", "0523": "泰州", "0790": "新余", "0791": "南昌", "0792": "九江", "0793": "上饶", "0794": "临川", "0795": "宜春", "0796": "吉安", "0797": "赣州", "0798": "景德镇", "0799": "萍乡", "0701": "鹰潭", "0350": "忻州", "0351": "太原", "0352": "大同", "0353": "阳泉", "0354": "榆次", "0355": "长治", "0356": "晋城", "0357": "临汾", "0358": "离石", "0359": "运城", "0930": "临夏", "0931": "兰州", "0932": "定西", "0933": "平凉", "0934": "西峰", "0935": "武威", "0936": "张掖", "0937": "酒泉", "0938": "天水", "0941": "甘南州", "0943": "白银", "0530": "菏泽", "0531": "济南", "0532": "青岛", "0533": "淄博", "0534": "德州", "0535": "烟台", "0536": "淮坊", "0537": "济宁", "0538": "泰安", "0539": "临沂", "0450": "阿城", "0451": "哈尔滨", "0452": "齐齐哈尔", "0453": "牡丹江", "0454": "佳木斯", "0455": "绥化", "0456": "黑河", "0457": "加格达奇", "0458": "伊春", "0459": "大庆", "020": "广州", "0751": "韶关", "0752": "惠州", "0753": "梅州", "0754": "汕头", "0755": "深圳", "0756": "珠海", "0757": "佛山", "0758": "肇庆", "0759": "湛江", "0760": "中山", "0762": "河源", "0763": "清远", "0765": "顺德", "0766": "云浮", "0768": "潮州", "0769": "东莞", "0660": "汕尾", "0661": "潮阳", "0662": "阳江", "0663": "揭西", "028": "成都", "0810": "涪陵", "0812": "攀枝花", "0813": "自贡", "0814": "永川", "0816": "绵阳", "0817": "南充", "0818": "达县", "0819": "万县", "0825": "遂宁", "0826": "广安", "0827": "巴中", "0830": "泸州", "0831": "宜宾", "0832": "内江", "0833": "乐山", "0834": "西昌", "0835": "雅安", "0836": "康定", "0837": "马尔康", "0838": "德阳", "0839": "广元", "0840": "泸州", "0730": "岳阳", "0731": "长沙", "0732": "湘潭", "0733": "株州", "0734": "衡阳", "0735": "郴州", "0736": "常德", "0737": "益阳", "0738": "娄底", "0739": "邵阳", "0743": "吉首", "0744": "张家界", "0745": "怀化", "0746": "永州冷", "0370": "商丘", "0371": "郑州", "0372": "安阳", "0373": "新乡", "0374": "许昌", "0375": "平顶山", "0376": "信阳", "0377": "南阳", "0378": "开封", "0379": "洛阳", "0391": "焦作", "0392": "鹤壁", "0393": "濮阳", "0394": "周口", "0395": "漯河", "0396": "驻马店", "0398": "三门峡", "0870": "昭通", "0871": "昆明", "0872": "大理", "0873": "个旧", "0874": "曲靖", "0875": "保山", "0876": "文山", "0877": "玉溪", "0878": "楚雄", "0879": "思茅", "0691": "景洪", "0692": "潞西", "0881": "东川", "0883": "临沧", "0886": "六库", "0887": "中甸", "0888": "丽江", "0951": "银川", "0952": "石嘴山", "0953": "吴忠", "0954": "固原", "0890": "儋州", "0898": "海口", "0899": "三亚", "0891": "拉萨", "0892": "日喀则", "0893": "山南", "0431": "长春", "0432": "吉林", "0433": "延吉", "0434": "四平", "0435": "通化", "0436": "白城", "0437": "辽源", "0438": "松原", "0439": "浑江", "0440": "珲春", "0770": "防城港", "0771": "南宁", "0772": "柳州", "0773": "桂林", "0774": "梧州", "0775": "玉林", "0776": "百色", "0777": "钦州", "0778": "河池", "0779": "北海", "0851": "贵阳", "0852": "遵义", "0853": "安顺", "0854": "都均", "0855": "凯里", "0856": "铜仁", "0857": "毕节", "0858": "六盘水", "0859": "兴义", "029": "西安", "0910": "咸阳", "0911": "延安", "0912": "榆林", "0913": "渭南", "0914": "商洛", "0915": "安康", "0916": "汉中", "0917": "宝鸡", "0919": "铜川", "0971": "西宁", "0972": "海东", "0973": "同仁", "0974": "共和", "0975": "玛沁", "0976": "玉树", "0977": "德令哈", "853": "澳门", "0470": "海拉尔", "0471": "呼和浩特", "0472": "包头", "0473": "乌海", "0474": "集宁", "0475": "通辽", "0476": "赤峰", "0477": "东胜", "0478": "临河", "0479": "锡林浩特", "0482": "乌兰浩特", "0483": "阿拉善左旗", "0591": "福州", "0592": "厦门", "0593": "宁德", "0594": "莆田", "0595": "泉州", "0595": "晋江", "0596": "漳州", "0597": "龙岩", "0598": "三明", "0599": "南平", "0550": "滁州", "0551": "合肥", "0552": "蚌埠", "0553": "芜湖", "0554": "淮南", "0555": "马鞍山", "0556": "安庆", "0557": "宿州", "0558": "阜阳", "0559": "黄山", "0561": "淮北", "0562": "铜陵", "0563": "宣城", "0564": "六安", "0565": "巢湖", "0566": "贵池" };
希望本文所述对大家的javascript程序设计有所帮助。

去掉重复并排序的方法:1、使用“Array.from(new Set(arr))”或者“[…new Set(arr)]”语句,去掉数组中的重复元素,返回去重后的新数组;2、利用sort()对去重数组进行排序,语法“去重数组.sort()”。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于Symbol类型、隐藏属性及全局注册表的相关问题,包括了Symbol类型的描述、Symbol不会隐式转字符串等问题,下面一起来看一下,希望对大家有帮助。

怎么制作文字轮播与图片轮播?大家第一想到的是不是利用js,其实利用纯CSS也能实现文字轮播与图片轮播,下面来看看实现方法,希望对大家有所帮助!

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于对象的构造函数和new操作符,构造函数是所有对象的成员方法中,最早被调用的那个,下面一起来看一下吧,希望对大家有帮助。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于面向对象的相关问题,包括了属性描述符、数据描述符、存取描述符等等内容,下面一起来看一下,希望对大家有帮助。

方法:1、利用“点击元素对象.unbind("click");”方法,该方法可以移除被选元素的事件处理程序;2、利用“点击元素对象.off("click");”方法,该方法可以移除通过on()方法添加的事件处理程序。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于BOM操作的相关问题,包括了window对象的常见事件、JavaScript执行机制等等相关内容,下面一起来看一下,希望对大家有帮助。

本篇文章整理了20+Vue面试题分享给大家,同时附上答案解析。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download
The most popular open source editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
