如何更新GitHub分支库?(How do I update a GitHub forked repository?)
我最近开了一个项目,并应用了几个修复。 然后,我创建了一个请求,然后被接受。
几天后,另一位贡献者又做了一次改变。 所以我的叉子不包含这个变化...我怎么能把这个改变成我的叉子?
当我进一步改变贡献时,是否需要删除并重新创建叉子? 还是有更新按钮?
I recently forked a project and applied several fixes. I then created a pull request which was then accepted.
A few days later another change was made by another contributor. So my fork doesn't contain that change.
How can I get that change into my fork? Do I need to delete and re-create my fork when I have further changes to contribute? Or is there an update button?
原文:https://stackoverflow.com/questions/7244321
最满意答案
这样做的方式是通过括号符号。
var test = { "id": "109", "No. of interfaces": "4" } alert(test["No. of interfaces"]);
欲了解更多信息,请阅读:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
The way to do this is via the bracket notation.
var test = { "id": "109", "No. of interfaces": "4" } alert(test["No. of interfaces"]);
For more info read out here:
相关问答
更多-
是否可以使用带有多个单词的字符串作为json键?(Is it possible to use a string with multiple words as json key? [duplicate])[2022-11-01]
你这样做: var j = { "kemon acho": "I am fine" }; console.log(j["kemon acho"]); You just do: var j = { "kemon acho": "I am fine" }; console.log(j["kemon acho"]); -
这样做的方式是通过括号符号。 var test = { "id": "109", "No. of interfaces": "4" } alert(test["No. of interfaces"]); 欲了解更多信息,请阅读: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects The way to do this is via the bracket notation ...
-
[你只是一个对象,而不是一个“json对象”。 JSON是一种文本符号。 引用的是使用数组初始化程序和对象初始化程序 (也称为“对象文字语法”)的JavaScript代码。] 如果您可以依靠具有ECMAScript5功能,您可以使用Object.keys函数来获取对象中的键(属性名称)的数组。 请注意,较旧的浏览器将不具备此功能。 如果没有,这是您可以自己提供的一个: if (typeof Object.keys !== "function") { (function() { var ...
-
JavaScript内部对象键,带有空格的字符串。?(JavaScript inner object key with a string having space .? [duplicate])[2021-08-09]
你可以像这样执行它 var stugrade = studentobject[0].studentinfo[0]['rama nathan']['grade']; You can execute it like this var stugrade = studentobject[0].studentinfo[0]['rama nathan']['grade']; -
从标准(第ii页) : 预计其他标准将引用这一个,严格遵守JSON文本格式,同时对各种编码细节施加限制。 这些标准可能需要具体行为。 JSON本身没有指定任何行为。 在标准(第2页)中进一步说明了JSON对象的规范: 对象结构表示为一对围绕零个或多个名称/值对的卷曲括号令牌。 名字是一个字符串。 每个名称之后都有一个冒号,它将名称与值分开。 单个逗号令牌将以下名称分隔开。 它没有提及重复的密钥无效或有效,所以根据规范,我会安全地认为这意味着它们被允许。 由于第一个引用,大多数JSON库的实现不接受重复的密钥 ...
-
我唯一能想到的是创建一个向对象添加前缀的函数: function addPrefix(target, prefix){ var newObj = false; if(target.constructor === Array){ newObj = []; for(var i = 0 ; i< target.length; i++){ item = target[i]; var itemObj = {}; ...
-
带空格的JSON数据(JSON data with spaces)[2023-04-30]
有多种方法可以实现相同的目标(一如既往)。 但是为了回答你的问题,我们采用一种方法来实现你的目标。 const body = { "Meta Data": { "1. Information": "High School", "2. Name": "St Marys" }, "Teachers' Names": { "Grade I": { "1. English": "Amanda Fernandez", "2. Sociolog ... -
使用AngularJS从JSON键和值中删除前导空格(Removing Leading Space from JSON Keys and Values Using AngularJS)[2022-04-13]
另一个答案可行,但我认为这更符合你的风格。 另请注意, 参数为v,k 。 angular.forEach(results, function (index) { angular.forEach(index, function (v, k) { delete index[k]; index[k.trim()] = v.trim(); }); }); The other answer will work but I think this is more of the styl ... -
您可以使用括号表示法访问 data['personal details'] 所有其他带空格的键和单个单词相同 data['personal details']['name'] 但它最好使用. 单字json键的点符号 data['personal details'].name // "Loren" data.address['temporary address'] // prints "Acn Block Ist Phase" You can access using bracket notatio ...
-
截至今天, org.json库版本20170516提供了accumulate()方法,该方法将重复的键条目存储到JSONArray JSONObject jsonObject = new JSONObject(); jsonObject.accumulate("a", "b"); jsonObject.accumulate("c", "d"); jsonObject.accumulate("c", "e"); jsonObject.accumulate("f", "g"); System.out.print ...