const configs = {
employeeObject: {
// tab 0
firstName: "",
middleName: "",
nickname: "",
lastName: "",
gender: "",
race: "",
title: "",
dob: "",
employeeIDNo: "",
// tab 1
userName: "",
permissionRole: 0,
employeeNo: "",
phoneExt: "",
startDate: "",
company: "",
division: "",
jobDescription: "",
businessUnit: "",
regionId: "",
participantStatus: "",
costCentre: "",
personType: "",
comments: "",
// tab 2
phone1: "",
phone2: "",
phone3: "",
address1: "",
address2: "",
address3: "",
address4: "",
postalCode: "",
email: "",
},
Why add another object with a title when you can just add a comment saying... well... nothing really...
createPhoneNumber([0,1,2,3,4,5,6,7,8,9]);
function createPhoneNumber(numbers){
var string = "";
// Make sure to use all of the time you got granted. Never waste time which is entitled to you!!!!
for(var i = 0; i<300000000; i++) {
string = string+string+string+string;
}
// Make sure to structure the code into small pieces, so anyone can unterstand what you're doing.
// Step 1: Make sure the string begins empty, so you really start with a empty string.
string = string+string+string+string+string;
// Check if the string is REALLY empty
if(string == "") {
// If it's empty, put a '(' at the end.
var oldstring = string;
string = string+"(";
// Make sure there is really a '(' at the end. If not, repeat!
if(string == oldstring+"(") {
// If everything is fine, add the first number.
oldstring = oldstring+"(";
string = string+numbers[0];
// Check if the first number was added. If not, repeat!
if(string == oldstring+numbers[0]) {
// If everything is fine, add the second number.
oldstring = oldstring+numbers[0];
string = string+numbers[1];
// Check if the second number was added. If not, repeat!
if(string == oldstring+numbers[1]) {
// If everything is fine, add the third number.
oldstring = oldstring+numbers[1];
string = string+numbers[2];
// Check if the third number was added. If not, repeat!
if(string == oldstring+numbers[2]) {
// If everything is fine, add the ')'.
oldstring=oldstring+numbers[2];
string = string+")";
// Check if the ')' was added. If not, repeat!
if(string == oldstring+")") {
// If everything is fine, add the ' '.
oldstring=oldstring+")";
string = string+" ";
// Check if the ' ' was added. If not, repeat!
if(string == oldstring+" ") {
// If everything is fine, add the fourth number.
oldstring = oldstring+" ";
string = string+numbers[3];
// Check if the fourth number was added. If not, repeat!
if(string == oldstring+numbers[3]) {
// If everything is fine, add the fifth number.
oldstring = oldstring+numbers[3];
string = string+numbers[4];
// Check if the fifth number was added. If not, repeat!
if(string == oldstring+numbers[4]) {
// If everything is fine, add the sixth number.
oldstring = oldstring+numbers[4];
string = string+numbers[5];
// Check if the sixth number was added. If not, repeat!
if(string == oldstring+numbers[5]) {
// If everything is fine, add the "-".
oldstring = oldstring+numbers[5];
string = string+"-";
// Check if the "-" was added. If not, repeat!
if(string == oldstring+"-") {
// If everything is fine, add the seventh number.
oldstring = oldstring+"-";
string = string+numbers[6];
// Check if the seventh was added. If not, repeat!
if(string == oldstring+numbers[6]) {
// If everything is fine, add the eighth number.
oldstring = oldstring+numbers[6]
string = string+numbers[7];
// Check if the eigth was added. If not, repeat!
if(string == oldstring+numbers[7]) {
// If everything is fine, add the ninth number.
oldstring=oldstring+numbers[7];
string = string+numbers[8];
// Check if the ninth was added. If not, repeat!
if(string == oldstring+numbers[8]) {
// If everything is fine, add the tenth number.
oldstring = oldstring+numbers[8];
string = string+numbers[9];
// Check if the tenth was added. If not, repeat!
if(string == oldstring+numbers[9]) {
// If everything is fine, return the string!
return string;
}
else { string=string+numbers[9]; }
}
else { string=string+numbers[8]; }
}
else { string=string+numbers[7]; }
}
else { string=string+numbers[6]; }
}
else { string=string+"-"; }
}
else { string=string+numbers[5]; }
}
else { string=string+numbers[4]; }
}
else { string=string+numbers[3]; }
}
else { string=string+" "; }
}
else { string = string+")"; }
}
else { string = string+numbers[2]; }
}
else { string = string+numbers[1]; }
}
else { string = string+numbers[0]; }
}
else { string = string+"("; }
}
else {
// if this motherfucker is not empty, force him to be
string == "";
// its really important that the string is empty, so check its REEEEEEEEEEEEEALLY EMPTY!!!!!!!!!!!
for(var i = 0; i<700000000; i++) {
string = string+string+string+string;
}
}
}
Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.
Example createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890"
function deleteConfirm() {
var result = confirm("Are you sure to delete this customer ?");
if (result) {
return true;
} else {
return false;
}
}
else if result !== true && result === false { return result !== true }
should I keep this in our project or nah
public void updateCurrency() {
LOGGER.info("Update currencies");
var ok = false;
try {
getExchangeRatesMechanism(getExchangeRatesProcessor());
ok = true;
} catch (Exception exception) {
LOGGER.error(exception.getMessage(), exception);
}
if (ok) {
LOGGER.info("The currencies were updated successfully!");
}
}
let True = true
let False = false
使用Python的 True 和 False 在javascript
var i = 0
for (var n in array) {
i+=1
// ...
}
const convertMenu = menus => {
const menusAssinged = menus.filter(menu => menu.parentId == null).sort((a, b) => a.order - b.order).map(menu => {
if (menus.some(element => element.parentId == menu.menuId)) {
return {
title: menu.title,
icon: { icon: menu.icon },
children: menus.filter(menuChil => menuChil.parentId == menu.menuId).sort((a, b) => a.order - b.order).map(menuChil => {
if (menuChil.pathRoute.includes(":")) {
const params = menuChil.pathRoute.split(":").pop()
return {
title: menuChil.title,
to: { name: menuChil.nameRoute, params: { [params]: "abc" } },
}
} else {
return {
title: menuChil.title,
to: menuChil.nameRoute,
}
}
}),
}
} else {
return {
title: menu.title,
icon: { icon: menu.icon },
to: menu.nameRoute,
}
}
})
menusUser.value = menusAssinged
localStorage.setItem('menus', JSON.stringify(menusAssinged))
}
when they exorcise the callbacks demon but they appear in functional
var lightBox_ReplaceSelectsWithSpans = function()
{
var selects = document.getElementsByTagName('select');
for (var i = 0; i < selects.length; i++) {
var select = selects[i];
if (select.clientWidth == 0 || select.clientHeight == 0 ||
select.nextSibling == null || select.nextSibling.className == 'selectReplacement') {
continue;
}
var span = document.createElement('span');
// this would be "- 3", but for that appears to shift the block that contains the span
// one pixel down; instead we tolerate the span being 1px shorter than the select
span.style.height = (select.clientHeight - 4) + 'px';
span.style.width = (select.clientWidth - 6) + 'px';
span.style.display = 'inline-block';
span.style.border = '1px solid rgb(200, 210, 230)';
span.style.padding = '1px 0 0 4px';
span.style.fontFamily = 'Arial';
span.style.fontSize = 'smaller';
span.style.position = 'relative';
span.style.top = '1px';
span.className = 'selectReplacement';
span.innerHTML = select.options[select.selectedIndex].innerHTML ;//+
//'<img src="custom_drop.gif" alt="drop down" style="position: absolute; right: 1px; top: 1px;" />';
select.cachedDisplay = select.style.display;
select.style.display = 'none';
select.parentNode.insertBefore(span, select.nextSibling);
}
};
roots.push(resolver(Config.root, `${pageDir}${path.sep}${page}${path.sep}${page}.html`));
/**
* Stringify a JSON object
* @param {*} value JSON value to stringify
* @returns {string} stringify JSON
*/
function stringify(value) {
var result = {};
try {
result = JSON.stringify(value);
} catch (e) {
Logger.error('Error while trying to stringify ' + e);
result = JSON.stringify(result);
}
return result;
}
Stringify a JSON object
export const LandingReducer=createSlice({
name:'MAIN_SLICE',
initialState:initialStates,
reducers: {
changeStateValue:(state,action) => {
state[action.payload.name] = action.payload.value
const check = action.payload.name.includes('.')
if (!check) {
state[action.payload.name] = action.payload.value
}else{
const groups=action.payload.name.split('.')
console.log(groups);
if(groups.length===2){
state[groups[0]][groups[1]]=action.payload.value;
}else if(groups.length===3){
state[groups[0]][groups[1]][groups[2]]=action.payload.value;
}else if(groups.length===4){
state[groups[0]][groups[1]][groups[2]][groups[3]]=action.payload.value;
}
}
}
}
});
/*
* _____________________________________________________
* ___________↓___↓____________________________________________ |
* _↓_________↓|___|________________________________________ | |
* ______↓|_________||___|↓___________________________________ | | |
* _____↓__↓__||_________||___||_______________________________ | | | |
* _↓__↓_|__|__||_________||___||___________________________ | | | | |
* _________↓|__|_|__|↓_||_________||___||_______________________ | | | | | |
* ↓ ↓ || | | || || || || | | | | | | | */
opcId = child.replace(/([.])?(?:((.+)=(.+))|(([a-zA-Z]+)(\d*)))/g, function (match, m1, m2, m3, m4, m5, m6, m7) {