This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function check(brackets_str) { | |
'use strict' | |
var stack = [], | |
brackets_arr = brackets_str.split(''), | |
open_brackets = ['(', '[', '{'], | |
close_brackets = [')', ']', '}']; | |
for (var i = 0, l = brackets_arr.length; i < l; i++) { | |
var b = brackets_arr[i]; | |
if (!!~open_brackets.indexOf(b)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function check(brackets_str) { | |
'use strict' | |
var stack = [], | |
brackets_arr = brackets_str.split(''), | |
open_brackets = ['(', '[', '{'], | |
close_brackets = [')', ']', '}']; | |
for (var i = 0, l = brackets_arr.length; i < l; i++) { | |
var b = brackets_arr[i]; | |
if (!!~open_brackets.indexOf(b)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* суть в том, что если | |
var url_string = request.url; | |
var params = url.parse(url_string, true).query; | |
console.log(params["name"]); | |
в одной области видимости с response.end() (то есть, в collection.find(), то всё работает, но я не знаю, как мне совместить добавление в БД и извлечение из неё, чтобы всё было хорошо и никто никому не мешал) | |
*/ | |
var http = require("http"); | |
var url = require("url"); | |
var Db = require ("mongodb").Db; |