This file contains hidden or 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
using System; | |
using Xunit; | |
namespace Inline_Out_Variables_Csharp | |
{ | |
public class UnitTest1 | |
{ | |
[Fact] | |
public void ParseEmptyGuid_Test_CsharpSyntax_7() | |
{ |
This file contains hidden or 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
using System; | |
using Xunit; | |
namespace Inline_Out_Variables_Csharp | |
{ | |
public class UnitTest1 | |
{ | |
[Fact] | |
public void ParseEmptyGuid_Test_OlderCsharpSyntax() | |
{ |
This file contains hidden or 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
using System; | |
var myUrl = new MyURL(); | |
//prints out https://localhost:8080/myCustomer | |
Console.WriteLine($"{myUrl}"); | |
return 0; | |
public class MyURL |
This file contains hidden or 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 myUrl = new MyURL(); | |
//prints out https://localhost:8080/myCustomer | |
Console.WriteLine($"{myUrl}"); | |
return 0; | |
public class MyURL | |
{ | |
private const string protocol = "https"; |
This file contains hidden or 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
using System; | |
var myUrl = new MyURL(); | |
//prints out https://localhost:8080/myCustomer | |
Console.WriteLine($"{myUrl}"); | |
return 0; | |
public class MyURL |
This file contains hidden or 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
write-host "`n ## NODEJS INSTALLER ## `n" | |
### CONFIGURATION | |
# nodejs | |
$version = "4.4.7-x64" | |
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi" | |
# git | |
$git_version = "2.9.2" |
This file contains hidden or 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
const employees = | |
[{ | |
employee: 'Eleanor R. Crane', | |
company: 'Tellus Faucibus Leo Incorporated', | |
dailyRate: 0, | |
salary: 15200 | |
}, | |
{ | |
employee: 'Haviva E. Lane', | |
company: 'Eu Neque Pellentesque Incorporated', |
This file contains hidden or 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
const TOTAL_WORKING_DAYS = 261; | |
//Horrible in my opinion, worst someone will say it is ugly. | |
const dailyRate = (item, index, array) => array[index].dailyRate = Math.floor(((item.salary * 12) / (TOTAL_WORKING_DAYS))); | |
//undefined as forEach doesn't return any results. | |
let dailyRateEmployeeResults = employees.forEach(dailyRate); | |
console.log(dailyRateEmployeeResults);//undefined |
This file contains hidden or 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
const TOTAL_WORKING_DAYS = 261; | |
const getDailyRate = salary => Math.floor(((salary * 12) / (TOTAL_WORKING_DAYS))); | |
const dailyRate = employee => Object.assign({}, { employee: employee.employee, dailyRate: getDailyRate(employee.salary) }); | |
//Returns a new set of empoloyees with dailyRate and name | |
const newEmployees = employees.map(dailyRate); | |
//new data |
This file contains hidden or 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
/*forEach loop*/ | |
let amounts = [1.25, 2.25, 3.25, 4.25]; | |
/** | |
* Outputs: | |
* 1.25 | |
* 2.25 | |
* 3.25 | |
* 4.25 | |
*/ |
NewerOlder